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.
SystemAdmin 110000D4XK746 Posts
Re: xpath issue2012-03-16T12:18:37ZThis is the accepted answer. This is the accepted answer.One 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.