Re: [xsl] How do you convert a string to a node-set?

Subject: Re: [xsl] How do you convert a string to a node-set?
From: Mike Brown <mike@xxxxxxxx>
Date: Tue, 26 Mar 2002 02:38:29 -0700 (MST)
Steve Renshaw wrote:
> How do you convert a string to a node-set? Is it possible with MSXSL3?
> This doesn't do the trick:
> <xsl:variable name="var" 
> select="msxsl:node-set('&lt;a&gt;3&lt;/a&gt;&lt;b&gt;4&lt;/b&gt;')"/>

Markup in an XPath/XSLT string object is not really meant to be parsed. How
did you end up with an XML fragment in a string in the first place? Solve that
problem, and this one will go away.

I believe the only other way is to use an extension function or extension
element of your own design. It would need to invoke MSXML to parse the string
as it would an external general entity (since the XML is not a well-formed
document... your example <a>3</a><b>4</b> does not have a document element).

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

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


Current Thread