xsl-list
[Top] [All Lists]

Re: Convert string from param to a nodeset in 2.0

2004-10-15 06:39:15
"Andrew" == Andrew Welch <ajwelch(_at_)piper-group(_dot_)com> writes:

    Andrew> Is there any way in xslt 2.0 to convert a string to a
    Andrew> node-set that is passed in as a parameter?

    Andrew> That is, I would like the calling application to be able
    Andrew> to pass in the string "<foo><bar/></foo>" and then operate
    Andrew> on that string as if it were a node-set.  I want to
    Andrew> convert the string inside the stylesheet, not force the
    Andrew> calling application to create the nodeset.

    Andrew> I believe I need to specify type string on the parameter
    Andrew> that receives the string, and then perform another
    Andrew> operation on that.  I'm sure I'm missing something obvious
    Andrew> here...

Andrew, this is not defined by XSLT 2.0, so it depends upon the
processor.
If your processor allows you to pass XPath expressions as parameter
values, then you could pass something like:

document ("string:<foo><bar/></foo>")

assuming that the URI resolver can handle a URI scheme of string
meaning an inline document
-- 
Colin Paul Adams
Preston Lancashire