Reputation: 13
I´m starting using xquery and I want to know how to get the values from 2 different type of tags. for example:
xml
<elementType>value</elementType>
<otherElementType>value</elementType>
<elementType>value</elementType>
<elementType>value</elementType>
xquery
"for $b in $doc//elementType return stringg($b)"
"for $b in $doc//otherElementType return stringg($b)"
I want this but only using one query, how can that be done?
Upvotes: 1
Views: 122
Reputation: 243449
Use what is possibly the shortest expression:
//*[self::elementType or self::otherElementType]/string()
Upvotes: 2