I am looking for some recommendations to make me move in the right direction. I am using xquery to return an XML document that is similar to the xml below.
<myDoc>
<myElements id="1">
<myElement key="one">aaa</myElement>
<myElement key="two" >bbb</myElement>
<myElement key="three">ccc</myElement>
</myElements>
<myElements id="2">
<myElement key="one">ddd</myElement>
<myElement key="two" >eee</myElement>
<myElement key="three">fff</myElement>
</myElements>
</myDoc>
I am trying to return a document with only specific lines <myElements>whose key is specified. For example, if the keys are "one" and "three", the resulting xml should look like this:
<myDoc>
<myElements id="1">
<myElement key="one">aaa</myElement>
<myElement key="three">ccc</myElement>
</myElements>
<myElements id="2">
<myElement key="one">ddd</myElement>
<myElement key="three">fff</myElement>
</myElements>
</myDoc>
Is it possible? Any advice that could point me in the right direction would be greatly appreciated.
source
share