|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Get extern xml document represented by a string
Hi Paulo,
> How can I get another xml document, represented by a string, to use
> in my xslt?
There isn't anything in XSLT that will let you do this. There are
several possibilities that might be appropriate depending on how
you're calling Xalan (from a command line? within Cocoon? within some
Java code?):
- in the code that calls Xalan, parse the string into a DOM and pass
that DOM in as a parameter to the stylesheet.
- construct an Entity Resolver that recognises a 'URL' for the
document, and use the document() function to access the DOM from
within the stylesheet.
- use a two-step process in which you first create an XML document
based on a string, and then transform that XML document.
- write an XML parser using XSLT and use that to parse the string.
The last one is a joke :)
Cheers,
Jeni
P.S.
It would be nice if XSLT processors supported the data: URI schema
because then you could just do:
document(concat('data:text/xml,' + $string))
to get hold of the XML document.
---
Jeni Tennison
http://www.jenitennison.com/
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








