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

RE: Retrieve External String XML Data as Object

Subject: RE: Retrieve External String XML Data as Object
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 27 Jun 2005 22:41:00 +0100
xml cookie
You write a URIResolver (under Java JAXP) or XmlResolver (under .NET) that
intercepts the URI and returns an object that the XSLT processor can handle,
for example (under JAXP) a StreamSource wrapping a StringReader that holds
the lexical XML.

Michael Kay
http://www.saxonica.com/ 


> -----Original Message-----
> From: John [mailto:john-xsl-list@xxxxxxxx] 
> Sent: 27 June 2005 21:09
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Retrieve External String XML Data as Object
> 
> I have a data source that is only available through APIs, not through 
> URLs or files.  I can represent this external data as XML, 
> but how can I 
> make this data available to my XSL?  The document() function seems to 
> require the first parameter be an URL, and the node-set 
> extensions don't 
> seem to handle strings (at least not the Microsoft node-set 
> extensions).
> 
> Where custom:GetData() basically returns some XML:
> 
> return( "<root><node>some text</node></root>" );
> 
> I have tried:
> 
> <xsl:variable name="extdata" select="msxsl:node-set( 
> custom:GetData())" />
> <xsl:value-of select="$extdata/root/node/text()" />
> 
> which gives 'cannot convert the operand to result tree fragment'.
> 
> I have also tried:
> 
> <xsl:variable name="extdata" select="document( custom:GetData())" />
> <xsl:value-of select="$extdata/root/node/text()" />
> 
> Which gives no output.  Do I have to make the data URL-accessible, or 
> how can I get this XML into my XSLT as an object instead of a string? 
> Should I convert the string to some other type of object before 
> returning it to the XSL?  Of course I would prefer to avoid 
> extensions 
> if possible.  Hopefully there is something like document() 
> that works on 
> strings instead of URLs?

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.