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

Re: How to select child elements of a given type

Subject: Re: How to select child elements of a given type
From: JBryant@xxxxxxxxx
Date: Mon, 26 Sep 2005 13:42:36 -0500
xsl for each select child
     <xsl:variable name="all">
                 <xsl:copy-of select="$path2pageAsSource | /root/folder" 
/>
     </xsl:variable>

produces a result tree fragment.

Try 

     <xsl:variable name="all" select="$path2pageAsSource | /root/folder" 
/>

Just as a general rule, always write your variables this way, unless 
circumstances force you to do otherwise.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)




Gustave Stresen-Reuter <tedmasterweb@xxxxxxx> 
09/26/2005 01:31 PM
Please respond to
xsl-list@xxxxxxxxxxxxxxxxxxxxxx


To
xsl-list@xxxxxxxxxxxxxxxxxxxxxx
cc

Subject
 How to select child elements of a given type






     <xsl:variable name="all">
                 <xsl:copy-of select="$path2pageAsSource | /root/folder" 
/>
     </xsl:variable>

         <xsl:for-each select="$all/descendant-or-self::folder">
             stuff...
         </xsl:for-each>

This for-each construct works with Saxon but not with Sablotron, 
libxslt, or Xalan-J.

If I remove the /descendant-or-self::folder it works fine (but of 
course, doesn't select the nodes I'm looking for).

I've tried using other shortcuts ($all//*/folder) and such, but they 
all return the same error.

Any ideas what the problem might be?

Ted Stresen-Reuter

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.