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

Convert escaped XML content to a treefrag, and then to

Subject: Convert escaped XML content to a treefrag, and then to a nodeset
From: "Karr, David" <David.Karr@xxxxxxxx>
Date: Thu, 24 Jul 2003 17:11:49 -0700
escaped xml
Continuing on an earlier problem, I have an XML file that has an element
which will have "escaped" XML content.  David Carlisle helped me
discover the "disable-output-escaping" attribute of "xsl:value-of",
which gives me a valid tree fragment.

Now, I need to convert that tree fragment to a nodeset so I can operate
on it.

I noticed the "xalan:nodeset" (and "exslt:node-set") function.  I assume
this takes a tree fragment and returns a nodeset.

I tried something like this:

--------------------
<xsl:template name="genother">
   <xsl:param name="others"/>
   <gork/>
   <xsl:for-each select="$others">
     <xsl:variable name="keyValue" select="key"/>
     <xsl:variable name="valueFrag">
       <xsl:value-of disable-output-escaping="yes" select="value"/>
     </xsl:variable>
     <xsl:variable name="valueNodes">
       <xsl:value-of select="xalan:nodeset($valueFrag)"/>
     </xsl:variable>
     <xsl:for-each select="$valueNodes">
...
--------------------

The "<gork/>" is just a flag to make sure I got there.

When I run this stylesheet on my XML (using xalanj 2.5.1), I get the
following:

SystemId Unknown; Line #0; Column #0;  XSLT Error
(org.apache.xpath.XPathException): Can not convert #STRING to a
NodeList!


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


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.