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

Re: recursion with xsl:apply-templates

Subject: Re: recursion with xsl:apply-templates
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 27 Aug 2003 12:37:05 +0100
xsl copy of apply templates
> Anyway, my primary problem remains. Any ideas?

I'm not sure quite what transform you wanted, but i think it's just an
identity transform plus copying the  @index'th id element from the
idlist??

which would be

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- identity -->
<xsl:template match="*">
 <xsl:copy>
 <xsl:copy-of select="@*/>
 <xsl:apply-templates/>
 </xsl:copy>
</xsl:template>

<!-- ignoring HEADER as you don't show that closing, assuming here that
all your REC_IR... elements are children of IRC 
It's _much_ easier if exampe input documents are complete (but short)
well formed documents -->

<!-- children of IRC with an index attribute
don't copy index and do copy id from id-list -->
<xsl:template match="IRC/*[@index]">
 <xsl:copy>
 <xsl:copy-of select="@*[not(name()='index')]/>
 <xsl:copy-of select="../../id_list/*[position()=current()/@index]"/>
 <xsl:apply-templates/>
 </xsl:copy>
</xsl:template>

</xsl:stylesheet>

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 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.