I want to pass a parameter into an XPath expression.
(//a/b/c[x=?],myParamForXAttribute)
Can I do this with XPath 1.0 ? (I tried string-join
but it is not there in XPath 1.0)
Then how can I do this ?
My XML looks like
<a>
<b>
<c>
<x>val1</x>
<y>abc</y>
</c>
<c>
<x>val2</x>
<y>abcd</y>
</c>
</b>
</a>
I want to get <y>
element value where x element value is val1
I tried //a/b/c[x='val1']/y
but it did not work.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…