[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|