|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: importing text-source in a xsl-stylesheet
> Now I want to include a certain header (lika a javascript-block) in > each of them (lets call it header.xsl). You can do the following: <!DOCTYPE xsl:stylesheet [ <!ENTITY header SYSTEM "header.txt"> ]> <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0" result-ns=""> <xsl:template match="foo"> &header; <xsl:apply-templates/> </xsl:template> </xsl:stylesheet> however note that 1) If your xsl engine uses a validating parser on the XSL file, you need to add a SYSTEM entry to that DOCTYPE pointing at a a DTD that matches the stylesheet you are using. 2) The header `text' file is still parsed as XML, so you still need to be careful of quoting < and &. 3) This is using general XML features rather than an XSL include mechanism, it is probably easier to put your header into a named template in an xsl file and then use the XSL import mechanism to include this into your stylesheets, then just access the header by calling the named template. David XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








