[xsl] node-set from a string?

Subject: [xsl] node-set from a string?
From: "Charles Knell" <cknell@xxxxxxxxxx>
Date: Tue, 02 Jul 2002 14:27:42 -0700
I need to find a way to pass a well-formed XML string into an 
XSLT transformation so that I can 
    a) Extract a bit of data from it to use during the transform
    b) Pass the string intact so that it becomes the value of an 
    HTML input in a web page which can subsequently submitted to 
    another page so as to preserve state information.

I am working with the Oracle XML Developer's Kit which I have used 
sucessfully for some months now. Now I'm coming to a feature which 
I haven't used before, but I've seen it discussed on the list from 
time to time.

I think I need to use the "oracle:node-set()" function to draw this 
string into an object (a node-set object) on which I can use XPath 
to extract the the bit of data I need during the transformation.

Looking on page 758 of XSLT Programmer's Reference (2nd Edition), I 
see what looks like the nugget I'm looking for. Except for one thing.
What I want to turn into a node-set comes into my XSLT as a parameter.

This parameter is a string (I've doubly-quoted it so that the processor

does not try to interpret it as an XPath statement. The example in the

book uses unquoted, literal XHTML in defining the content of the variable.

Here is the place where I try to make the magic happen:

...
<xsl:param name="passThroughs" />
 <xsl:template match="/">
  <xsl:variable name="passThroughDoc" select="oracle:node-set($passThroughs)"
    xmlns:oracle="http://www.oracle.com/XSL/Transform/java"; />
...
And here is the error message I get when I fail:
ORA-20100: Error occurred while processing: XSL-1019: 
  (Error) Expected 'result-tree-fragment' instead of 'string'.

Am I completely on the wrong path here, or is there some small thing

which has escaped my notice?

Thanks.

-- 
Charles Knell
cknell@xxxxxxxxxx - email
 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread