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

RE: what does this statement mean?

Subject: RE: what does this statement mean?
From: <Jarno.Elovirta@xxxxxxxxx>
Date: Thu, 10 Mar 2005 12:41:48 +0200
the following statement means

> Im trying to rearrange the order of my XML elements using the
> <xsl:copy>
> feature of XSLT 2.0. However Im having trouble with one line of code
> which causes my processor to run into an infinite loop.
> Could someone please let me know what this particular
> <xsl:apply-templates select="*[1]" mode="walker"/> means and what
> exactly its trying to do (this was a piece of code that was
> suggested by
> someone from this list).

Might have been me, I use the "walker" mode name for that sort of grouping.
Basically it's a grouping method that walks through a flat list of elements
and the "walker" mode templates decide whether to stop the walking or

> The full code is shown below :
> ----------------------------
> <xsl:template match="/">
>     <Top>
>         <xsl:apply-templates select="Top/SubConcepts"/>
>     </Top>
> </xsl:template>
> <xsl:template match="SubConcepts">
>     <xsl:copy>
>       <xsl:apply-templates select="@*"/>
>       <xsl:for-each select="descendant::SubConcept">
>         <xsl:copy>
>           <xsl:apply-templates select="@*"/>
>           <xsl:apply-templates select="*[1]" mode="walker"/>
>     <!--problem with this line of code-->
>         </xsl:copy>
>       </xsl:for-each>
>     </xsl:copy>
> </xsl:template>
> <xsl:template match="Value | ChildConcept" mode="walker">
> <!-- problems during execution-->
>     <xsl:apply-templates select="."/>
>     <xsl:apply-templates select="following-sibling::*" mode="walker"/>

This should be

  <xsl:apply-templates select="following-sibling::*[1]" mode="walker"/>

i.e. continue to the next sibling, not to all of them.

> </xsl:template>
> <xsl:template match="*" mode="walker">
>             <!-- problems during execution-->
>     <xsl:apply-templates select="following-sibling::*" mode="walker"/>

Same here, it should be

  <xsl:apply-templates select="following-sibling::*[1]" mode="walker"/>


Jarno - Neuroticfish: Skin (Binary 2002)

Current Thread


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.
First Name
Last Name
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.