Skip to content

Instantly share code, notes, and snippets.

@breezhang
Created March 30, 2012 11:41
Show Gist options
  • Save breezhang/2250995 to your computer and use it in GitHub Desktop.
Save breezhang/2250995 to your computer and use it in GitHub Desktop.
xslt import css file
[From] (http://stackoverflow.com/questions/1038101/how-to-inline-css-and-javascript-through-xsl)
You CSS file
<!--/*--><root><![CDATA[<!--*/-->
body
{
margin: 0;
}
div > p
{
background-color: yellow;
}
<!--/*-->]]></root><!--*/-->
XSL file
<style type="text/css">
<xsl:value-of select="document('test.css')" disable-output-escaping="yes" />
</style>
@breezhang
Copy link
Author

XSLT 1.0, if you don't need to be too script about the CSS, you can use the following to make the CSS file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment