[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Can unparsed-text() consume an in-memory XML docu
Dear Roger,
I'll assume you are using XSLT 2.0. On 8/13/2012 4:15 PM, Costello, Roger L. wrote: I have an XSLT program that uses unparsed-text() to read in an XML document from a URL, the program then does some string manipulations on the string version of the XML document, and then outputs the result. Cool. Question about the input to unparsed-text(): If an XML document has been parsed and is now available as an XDM instance (a full-fledged tree, not a string), then it isn't subject to string manipulations as such, so no. You could, however, manipulate any strings you derived from it, including values of text nodes or elements in the tree or indeed of the tree itself. Depending on what your operations are and whether they expect or require XML markup, this could be fine for you. You could also reserialize the tree into XML (as a string bound to a variable or parameter) using XSLT to serialize it (see Evan Lenz at http://lenzconsulting.com/xml-to-string/ for some ideas on this), and then process that. (This is not an approach I would ordinarily recommend, but you might have a special case.) Question about reconstituting an XML document from the string version of the XML document: In theory it is possible to implement an XML parser in XSLT, although it won't be a trivial task. (Yet at Balisage I just demonstrated an XSLT pipeline to process LMNL syntax, which is almost as hard. See the Proceedings.) Saxon has an extension function, saxon:parse, that will also do this, if you have Saxon-PE or EE. Cheers, Wendell -- ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
|
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
|