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

RE: preceding sibling

Subject: RE: preceding sibling
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Mon, 19 Apr 2004 20:02:46 +0200
xsl first preceding sibling
> -----Original Message-----
> From: Kaarle Kaila [mailto:kaarle.kaila@xxxxxx]
>

Hi,

<snip />
> I tried this but it compared to names too far back. The comparision should
> be made only to name/givenname elements withing notice[@tag='NAME']
elements
> whithin a person element.
>

And this would be false when... the first preceding notice node with an @tag
equal to 'NAME' occurs outside of the current person node (?)

> The suggestion you gave compared also with a name of the previous
> person and that should be avoided.

[yup! delete question-mark from the above :) ]

So, you need the first preceding notice node with @tag equal to 'NAME'
having the same person ancestor as the current node...

You could try:

<xsl:template match="givenname">
  <xsl:variable name="vPID" select="generate-id(ancestor::person)" />

  <xsl:if test="not(preceding::notice[@tag='NAME'
            and generate-id(ancestor::person)=$vPID][1]/name/givenname[
              .=current()])">
    <xsl:value-of select="." />
  </xsl:if>
</xsl:template>

and see if that matches what you are looking for.



Cheers,

Andreas

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.