[MarkLogic Dev General] search elements and attributes of all documents

Pradeep Maddireddy Pradeep.Maddireddy at HTCinc.com
Tue Dec 30 13:57:09 PST 2008


Hi..!

 

How can we write an Xquery function to find the documents (XML documents
with different structures) that have the word "fruit" in them either as
an element or attribute? 

 

For example say Doc1 has the following content

 

<root>

<Category>fruit</Category>

<name>Apple</name>

</root>

 

Doc2 has the following content

 

<root>

<name category="fruit">Apple</name>

</root>

 

Both the documents should be selected as the first document has "fruit"
as element and second document has "fruit" as an attribute.

 

Thanks in advance.

 

Regards,

Pradeep Maddireddy

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xqzone.marklogic.com/pipermail/general/attachments/20081230/31f5ef78/attachment.html


More information about the General mailing list