473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Cascading styles through XSLT

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 1589
jkmyoung
2,057 Expert 2GB
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
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
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...
4
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>...
2
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...
7
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...
5
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...
1
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...
9
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...
2
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.