xsl-list
[Top] [All Lists]

Retrieve External String XML Data as Object

2005-06-27 13:08:40
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?



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>