W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2002

Re: Need help with an XPath expression in XSLT

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 10 Apr 2002 18:02:13 +0100
Message-ID: <127725318242.20020410180213@jenitennison.com>
To: Brenda Bell <bbell@juicesoftware.com>
CC: xmlschema-dev@w3.org
Hi Brenda,

XSLT questions should be directed at XSL-List
(http://www.mulberrytech.com/xsl/xsl-list). This list is for XML
Schema questions.

> I have an XSLT transformation where I need to add an attribute to
> any given element <D> if the value of <B> is 1 where <D> and <B>
> have the same ancestor <A>.
> I'm having trouble getting the right expression on my <xsl:if> element to
> test the value of the right <B> element given a context node of <D>.

From the D element, you need to go up to the ancestor A element:


then down to its child B element:


and then test if that is 1:

  ancestor::A/B = 1



Jeni Tennison
Received on Wednesday, 10 April 2002 13:02:15 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:56 UTC