[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: document() for non-XML documents

Subject: RE: document() for non-XML documents
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Mon, 27 Sep 1999 09:41:16 -0600
xsl document non xml
> 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 "&#xA0;">
]>
...
<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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.