[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: embad css in in xsl
Tempore 00:09:30, die 03/09/2005 AD, hinc in
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit henry human
<henry_human@xxxxxxxx>:
is that possible to define format of element in a xsl stylesheet (embad css Stylesheet like in html head)? Hi, There are two ways to interpret your question. 1) you want to display the xsl document itself by means of an css stylesheet Just like in any xml document, you can add reference to stylesheets: consider this XSLT: <?xml-stylesheet type="text/css" href="test.css"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes" /> <xsl:template match="root"> xsl code </xsl:template> </xsl:stylesheet> and a css file , named 'test.css', containing: @namespace xsl url(http://www.w3.org/1999/XSL/Transform); xsl|template {color: red} Then the XSL document could be rendered as a string 'xsl code' in red. 2) you want to embed css rules in your output document. Just make the necessary elements be added to the result tree: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes" /> <xsl:template match="root"> <html> <head> <style type="text/css"> /*css rules here*/ </style> </head> <body> <p>test</p> </body> </html> </xsl:template> </xsl:stylesheet>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|