This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]