Re: [xsl] embad css in in xsl

Subject: Re: [xsl] embad css in in xsl
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Wed, 09 Mar 2005 13:15:36 +0100
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)?


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="";>
<xsl:output method="xml" indent="yes" />

<xsl:template match="root">
xsl code


and a css file , named 'test.css', containing:

@namespace xsl url(;
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="";>
<xsl:output method="html" indent="yes" />

<xsl:template match="root">
		<style type="text/css">
			/*css rules here*/


regards, -- Joris Gillis ( Fiat W3C in tenebris

Current Thread