Oxygen XML Editor
 
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Searching in Sub-children from an Array


Subject: Re: [xsl] Searching in Sub-children from an Array
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 4 Dec 2006 16:35:51 GMT

in xslt2 something like

 <xsl:key name="ids" match="*" use="@ID"/>

<xsl:template match="Steps">
 <xsl:variable name="ids" select="tokenize(.,',\s*')"/>
 <xsl:apply-templates mode="step" select="key('ids',$ids[1])[1]">
   <xsl:with-param name="ids" select="$ids[position()!=1]"/>
  </xsl:apply-templates>
</xsl:template>

<xsl:template mode="step" match="*">
 <xsl:param name="ids"/>
 do something with this node then
  <xsl:apply-templates mode="step" select="key('ids',$ids[1],.)[1]">
   <xsl:with-param name="ids" select="$ids[position()!=1]"/>
  </xsl:apply-templates>
</xsl:template>

David


Current Thread
 
© 2002-2008 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy
This website was created & generated with <oXygen/> XML Editor