Rick Roen wrote:
Hi
<style type="text/css"> @import "salesdoc.css"; </style>
This (the "@import") is plain text for XSLT. You can use unparsed-text() to read a file as a string:
~> cat import-css.xsl
<xsl:transform
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="/">
<style type="text/css">
<xsl:text> </xsl:text>
<xsl:copy-of
select="unparsed-text('import-css.css')"/>
</style>
</xsl:template>
</xsl:transform>
~> cat import-css.css
body {
color: #333;
}
~> saxon import-css.xsl import-css.xsl
<style type="text/css">
body {
color: #333;
}
</style>
Regards,
--drkm
XSLT 2.0 provides the unparsed-text() function to read documents via URL