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

collect elements into variable and apply-templates

Subject: collect elements into variable and apply-templates
From: "Rui Alberto L." Gonçalves <rui-l-goncalves@xxxxxxxxxxxxx>
Date: 19 Feb 2004 19:50:31 +0000
variable in apply templates
Hi,
I need to collect some elements from a document into a
variable and then apply-templates the the resulting variable:

Example:
XSL
===
<xsl:template match="doc">
  <xsl:variable name="a">
    <xsl:for-each select="xxx/*">
        <xsl:copy-of select="."/>
    </xsl:for-each>
  </xsl:variable>

  <!-- ILLEGAL -->
  <xsl:apply-templates select="$a"/>

</xsl:template>

XML
===
<doc>
    <xxx>
     <item> test1 </item>
    </xxx>
    <xxx>
      <item>test5</item>
    </xxx>
</doc>
this results in:
(Location of error unknown)XSLT Error (org.apache.xpath.XPathException):
 Can not convert #RTREEFRAG to a NodeList!

Does anyone have an idea how can I solve this problem?

thanks for any help.

Rui


-- 
Rui Alberto L. Gonçalves <rui-l-goncalves@xxxxxxxxxxxxx>
PT Inovação


 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.