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

RE : Re: Complex recursion in XSLT 1.0

Subject: RE : Re: Complex recursion in XSLT 1.0
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Wed, 20 Feb 2008 16:49:59 +0100 (CET)
 RE : Re:  Complex recursion in XSLT 1.0
Mukul Gandhi wrote:

>    Could you kindly demonstrate with a small code snippet,
> how to implement stack in a XSLT 2.0 stylesheet ...

    <xsl:function name="x:push" as="item()+">
       <xsl:param name="stack" as="item()*"/>
       <xsl:param name="item"  as="item()"/>
       <xsl:sequence select="$item, $stack"/>
    </xsl:function>

    <xsl:function name="x:pop" as="item()*">
       <xsl:param name="stack" as="item()*"/>
       <xsl:sequence select="remove($stack, 1)"/>
    </xsl:function>

    <xsl:function name="x:top" as="item()?">
       <xsl:param name="stack" as="item()*"/>
       <xsl:sequence select="$stack[1]"/>
    </xsl:function>

  :-)

  That's just an idea, you might want to control more
precisely errors (what if one pops an empty stack?, etc.)

  Regards,

--drkm






















      _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail http://mail.yahoo.fr

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-2007 All Rights Reserved.