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.
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.