473,657 Members | 2,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cascading styles through XSLT

2 New Member
Hi.

I have the following XML ..

Expand|Select|Wrap|Line Numbers
  1. <?xml-stylesheet type="text/xsl" href="try.xslt"?>
  2. <head>
  3.     <title>Title</title>
  4.     <desc> <p>Description<ul><li>item 1</li><li>item 2</li></ul></p>
  5.     </desc>
  6. </head>
I am trying to transform it into the following HTML using XSLT.

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <p style="font-size: 11px; line-height: 15px;">
  4.    <!-- content of the <desc> tag in the XML should appear here.
  5. </p>
  6. </body>
  7. </html>
The problem is that I have some styles defined for the para tag above in the HTML. This doesn't cascade down into the para tags present in the content of the <desc> tag in the XML.

What I get is this...

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <p style="font-size: 11px; line-height: 15px;">
  4.    <p>Description<ul><li>item 1</li><li>item 2</li></ul></p></p>
  5. </body>
  6. </html>
I have been asked not to use CSS due to earlier problems in getting it to display correctly in certain email clients and instead use only inline styles. I also don't have control over the XML and I have been informed that the content of the <desc> tag will contain rich text (with HTML formatting tags).

So, is there anyway I can cascade the styles defined above to the para tags within the content of the <desc> tag?

Any help/pointers is appreciated. Thanks.
Dec 4 '07 #1
2 1598
jkmyoung
2,057 Recognized Expert Top Contributor
The problem might be related to the use of paragraph <p> tags instead of using <div>s Can you use <div> instead?
Dec 4 '07 #2
bruce131
2 New Member
Thanks a lot! It did the trick. :)
Dec 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

31
6808
by: Axel Dahmen | last post by:
I try to combine properties of several classes. This is done by assigning a space separated list of class definitions to an element. However, IE shows a kind of preference when choosing the right property which I think is probably wrong. Here's what it does: If two classes are defined in a stylesheet providing the same property, and if these two classes are assigned to one single element, the preference which class's property is used is...
4
1917
by: Thomas Mlynarczyk | last post by:
Hi, I just ran into some problems when I tried to "style" the <a> elements of a page. Basically, I have something like this: <div id="left"> <div id="menu"> <a href="bla">Bla</a> </div> <a href="foo">Bar</a>
2
2045
by: pp | last post by:
What would you say about a smart script that would transform really 'cascading' style sheet into appropriate CSS structures. When coding css by hand, most often you are forced to write the statements separately in lines, e.g. --- A {css-properties:A; } A B C {css-properties:C;} A B D {css-properties:D; } A B D:hover {css-properties:Dhover; }
7
1505
by: CheGueVerra | last post by:
First of all Hello all you css freak. geeks and gurus. I just started using css for some web pages I had to do at work and I'im testing some stuff at home to understand more. Now, I wanted to understand better of how cascading works. in my .css file I created this tr#noLine{ border-top-width:0; border-left-width:0;
5
1675
by: JezB | last post by:
Is it possible to programatically examine and modify a page's Styles (including Cascading Style Sheets) within the code-behind-module (eg. c#) ? My guess is that since these are HTML elements the answer is no, since these will only exist in the browser whereas the code-behind runs on the web server, but I wanted verification from you experts out there (I'm new to ASP.NET). If the answer is no, is it possible via javascript ?
1
2063
by: daniele74 | last post by:
Hy, I want ask you this question. I have two schema file schema1.xsd and schema2.xsd. then I have a stylesheet transformation style2.xsl that show in a browser an xml file that has schema2.xml as schema. moreover I have an xslt tranformation that map schema1.xsd in schema2.xsd (schema1TOschema2.xslt). so the question is: it is possible to use style2.xsl to view xml file that has schema1 as schema?? with instractions similar to this...
9
2020
by: Radium | last post by:
Cascading Style Sheet is an extreme hazard to your privacy. It allows others on the internet to see your monitor and files. It allows them to copy images on your monitor to their computers. It also allows them to copy files from your computer to their's. It is dangerous. Avoid at all costs. CSS that isn't stored in the victim's computer. Instead it is stored in the perpetrator's PC. What it does is it reads everything on the victim's...
2
2044
by: tschwartz | last post by:
I have an xml document in which elements are hierarchically related to eachother conceptually. Unfortunately, the hierarchical relationship is not modelled in the schema (i.e., the elements are "flattened" in the document". I have a case in which I want to remove a high level element using xslt and want all the related lower-level elements to be removed as well. Is there an easy way to do this in a template? For example, imagine a...
3
3128
by: Martin Bretschneider | last post by:
Hi, ms word should output xhtml without any css style. Tidy (http://tidy.sourceforge.net/) helps quite a lot but leaves the css styles like the following: <p class="P11 c2">foo</p> <ul class="c4"> <li class="P11 c3"> <p class="P11 c2">bar</p>
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8838
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.