This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Get extern xml document represented by a string
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: "Paulo Henrique S. Bermejo" <bermejo at eps dot ufsc dot br>
- Cc: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 10 Dec 2001 17:36:46 +0000
- Subject: Re: [xsl] Get extern xml document represented by a string
- Organization: Jeni Tennison Consulting Ltd
- References: <00a901c1819e$5b3aa370$2433a296@TATIANA>
- Reply-to: xsl-list at lists dot mulberrytech dot com
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