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

Re: Path according to a child node attribute

Subject: Re: Path according to a child node attribute
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Sat, 31 Dec 2011 11:59:51 +0100
Re:  Path according to a child node attribute
Gian Paolo Bernardini wrote:

I'm founding difficulties on adding a child element as last child of the
node (i.e.<Path>) and on making the right path building (i.e. accessing the
attributes and values of the father, of the grandfather or of the great
grandfather based on the SuperClass code of each Class).
Using SaxonHE9-4-0-1J.

Any ideas? Thanks in advance

Here is a sample stylesheet:


<xsl:key name="k1" match="Class" use="@code"/>

  <xsl:template match="@* | node()">
      <xsl:apply-templates select="@* | node()"/>

<xsl:template match="Class">
<xsl:apply-templates select="@* | node()"/>
<xsl:apply-templates select="key('k1', SuperClass/@code)" mode="path"/>

  <xsl:template match="Class" mode="path">
    <xsl:variable name="next" select="key('k1', SuperClass/@code)"/>
    <xsl:if test="$next">
      <xsl:apply-templates select="$next" mode="path"/>
    <xsl:value-of select="concat(@code, ' ', Rubric)"/>



	Martin Honnen --- MVP Data Platform Development

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.