Forum Discussion
M_McDonald
16 years agoSuper Contributor
Not to trod on any support engineer toes
, but if you want the attribute value, here is a simple example. For the following XML:
[tt:3t04iip3]
PEARS ARE GOOD FOR YOU
SO ARE APPLES
[/tt:3t04iip3]
this XQuery:
[tt:3t04iip3]for $f in //fruits/fruit
where $f/@fruitId='apple'
return{data($f/@fruitId)} [/tt:3t04iip3]
will give the following:
[tt:3t04iip3]apple [/tt:3t04iip3]
I think the result needs to be valid XML rather than just a text value.
, but if you want the attribute value, here is a simple example. For the following XML:[tt:3t04iip3]
this XQuery:
[tt:3t04iip3]for $f in //fruits/fruit
where $f/@fruitId='apple'
return
will give the following:
[tt:3t04iip3]
I think the result needs to be valid XML rather than just a text value.