Using MarkLogic, but this is probably a general XQuery question.
I have:
<library>
<books>
<book title="whatever">
<publisher>Random</publisher>
....more children
</book>
<book title="another">
<publisher>Simon</publisher>
....more children
</book>
...
</books>
</library>
I want to return all the [book] elements with their title attributes, but I DO NOT want any of the children of the book, for example. [Publisher]. How to do it in an orthodox and executive manner?
Correlated question: sometimes I may want to get some of the children, but not others, for example. get all the elements of the book and their children of the publisher, but not one of the other children.
Thank.
source
share