RE: document() for non-XML documents
> The document() function allows me to merge multiple XML input > documents. [...] > > However, suppose I want to insert the contents of a simple text file: > > <include href="compositions.txt"/> The document() function returns a node-set, so as you discovered, the function does not create a node-set when the argument is the URI of a non-XML file. Perhaps in the future, if the file exists and is not XML, the default could be to assume there is a <document> element with the document contents as a single child text node. Until then, it sounds like you don't really need the included file to be treated as a source tree. Why don't you just declare an external entity: <!DOCTYPE xsl:stylesheet [ <!ENTITY sometext SYSTEM "compositions.txt">\ <!ENTITY nbsp " "> ]> ... <foo>Here's that file: &sometext;</foo> One thing I'm not clear on is whether appending to the DTD for an XSL document by (re)declaring it is actually valid. Anyone? 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