Subject:CSS within XSLT ? Author:steven matthews Date:27 Dec 2006 09:44 AM
HI Team,
I know that XSLT and CSS are often viewed as competing technologies but what I would like to know is whether it is possible to state CSS styling preferences within an XSLT stylesheet, as the example source code below tries to do.
The problem that I have is that I have static web pages styled with CSS, but I wish to create dynamic XML from a database dump which needs styling with XSLT (creating DHTML) using the same styles found in static web pages (under CSS control). Up to this point, I get around the problem by simply using those same styles in the XSLT style sheet.
Problem is, I have to repeat this for each XSLT style sheet used.
Subject:CSS within XSLT ? Author:Minollo I. Date:27 Dec 2006 09:58 AM
Only if you don't know what CSS or XSLT are you could consider them two competing technologies; CSS is about defining and using styles in your HTML pages; XSLT is about transforming XML into something else, often HTML or other XML.
You can surely create an XSLT that creates an HTML that includes and relies on a specific CSS file; you can also think about defining a shared one taking care of the CSS inclusion, then importing it in other XSLT stylesheets.