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

RE: Still battling with practical strategy for parsing

Subject: RE: Still battling with practical strategy for parsing escapedXML inside unescaped XML
From: "Karr, David" <David.Karr@xxxxxxxx>
Date: Tue, 29 Jul 2003 09:55:46 -0700
xsl value of unescape
Comments below.

> -----Original Message-----
> From: Américo Albuquerque [mailto:melinor@xxxxxxx]
> 
> > -----Original Message-----
> > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> >
> > -----filter.xsl---------
> >
> >   <xsl:template match="other">
> >     <xsl:variable name="keyValue" select="key"/>
> >     <xsl:variable name="values">
> >       <xsl:call-template name="unescape">
> >         <xsl:with-param name="str" select="value"/>
> >       </xsl:call-template>
> >     </xsl:variable>
> 
> Here you have you'll have to use vendor:node-set() function to change from
> rtf to nodelist
> 
> define in your xsl:stylesheet the fn namespace:
> <xsl:stylesheet ...  xmlns:fn="http://exslt.org/common">
>  ...
>  <xsl:for-each select="fn:node-set($values)">
> 
> >     <xsl:for-each select="$values">
> >       <xsl:value-of select="$keyValue"/>-<xsl:value-of
> > select="name()"/>
> >     </xsl:for-each>
> >   </xsl:template>
> > </xsl:stylesheet>
> > -----filter.xsl---------
> >
> > --------shell output------
> > [;] xalan -IN data.xml -XSL filter.xsl
> >
> file:.../filter4.xsl; Line #23; Column #33;  XSLT Error
> (org.apache.xpath.XPathException): Can not convert #RTREEFRAG to a
> NodeList!
> --------shell output------

I don't think it will do much good to change how I iterate through the variable, because the error occurs on the assignment to the variable, which is before the "for-each".

I also already tried changing your script to call "node-set" on the return value.

I changed this in your original script:

      <xsl:otherwise>
        <xsl:value-of select="$str"/>
      </xsl:otherwise>

to:

      <xsl:otherwise>
        <xsl:value-of select="xalan:nodeset($str)"/>
      </xsl:otherwise>

I made sure to add the namespace in the stylesheet attributes.  When I did this, it didn't fix the problem.  It didn't even change the error message.

 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.