I have xml structure as:
I want to write xpath with local-name() to pick the value of tag <value> when value of <tag1> is "product_Add".
NOTE# i don't want to include namespace in xpath.
NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
1 reply Latest Post - 2012-03-16T12:18:37Z by SystemAdmin
Pinned topic xpath issue
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-03-16T12:18:37Z at 2012-03-16T12:18:37Z by SystemAdmin
SystemAdmin 110000D4XK746 PostsACCEPTED ANSWER
Re: xpath issue2012-03-16T12:18:37Z in response to SystemAdminOne possible among others (with more or less assumptions on the context and precise hidden conditions) is the following - I put it in a xslt select as illustration:
<xsl:value-of select= "descendant-or-self::*[local-name()='value'] [preceding-sibling::*[local-name()= 'tag1'][normalize-space()= 'product_Add']] " />
A hidden assumption for the above, for instance, is that as long as there is at least one tag1 of that text content, the value tag will be a valid choice. If you want to have more precision on the position of such tag1 of that text content, add a condition (on position) for that purpose.