[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 escaped XML inside unescaped XML
From: Américo Albuquerque <melinor@xxxxxxx>
Date: Wed, 30 Jul 2003 13:40:37 +0100
unescape in xsl
Hi.

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Karr, David
> Sent: Tuesday, July 29, 2003 5:56 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  Still battling with practical strategy for 
> parsing escaped XML inside unescaped XML
> 
> 
(...)
> 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>
> 

The stylesheet I provided worked only with strings, it doesn't have any
node, just text that looks like markup, there for you can not do
xalan:nodeset($str), it will be the same as doing
xalan:nodeset("<sometag>opps</sometag>"). It won't work. What you need to do
is to apply those templates inside the definition of a variable and use the
xalan:nodeset() on that variable.

Something like:
<xsl:variable name="mymarkup">
  <xsl:call-template name="unescape">
    <xsl:with-param name="str" select="value"/>
  </xsl:call-template>
</xsl:variable>

 <xsl:for-each select="xalan:nodeset($mymarkup)">
Or
 <xsl:apply-templates select="xalan:nodeset($mymarkup)"/>

You have to be sure that the string you pass to it is a well-formed xml text
representation

Hope this help

Regards,
Américo Albuquerque




 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.