If you do the XQL query /doc/name and set the result type to Object, you will get a node object with name as the root of the document.
You can verify this by mapping the result of the /doc/name query, which is an Object called the name of the query, into another queryXMLNode call with the XQL query /source(). You will see the document that contains the name element as the container.
If you send any XMLNode through xmlNodeToDocument the root of the document will be output as the pipeline key “document”. If you want it to be called “name” you can add a Map step to rename it.
Hi Bob,
You can get a XMLstring for the specific node by using WQL
doc.name[0].source. It will give you desired output i.e.
<name>
<first>John</first>
<last>Smith</last>
</name>
You can convert it to node by using pub.xml:xmlStringToXMLNode service.
Fred’s query will also work fine to give you the node directly.
Cheers
Akash
What should I write as a WQL query if I want to get the handle of the Object which has version as “001” and the name as “name1”? Any help would be appreciated.