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

Re: Identity Tranlate, too many nested apply-templates

Subject: Re: Identity Tranlate, too many nested apply-templates
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Tue, 24 Mar 2009 17:26:04 +0100
Re:  Identity Tranlate
Karl Stubsjoen wrote:
So I have something like this:

        <xsl:element name="Orders">
            <xsl:apply-templates select=". |
following-sibling::Order[CustomerID = current()/CustomerID]" />
            </xsl:element>
        </xsl:element>


Consider the above a unique match on a node "Order", to which I'm wrapping in a new node "Orders", and performing other node magic. I am then applying templates, as you see, to grab all Order nodes which have same CusomterID value. There is also the . "dot" so that I am adding the uniquely matched Order node to the result.

I have your basic identity copy routine, and it fails in here with
"Too many nested apply-templates calls".  If I remove the . "dot" in
the select above, I do not get this error.  Why?

Can you show us the match pattern? If the above is in an <xsl:template match="Order"> and you then do <xsl:apply-templates select="."/> then you get infinite recursion, don't you? You might want to use a mode attribute to avoid that.



--

	Martin Honnen
	http://JavaScript.FAQTs.com/

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.