The output of an adapter service is a document list which contains string — which inturn holds xml data.
I need a search for a particular string in the list of xmls.
One way i can think of is … loop over the results and then convert each xml to document and then search for string in the particular node.
But i do not want it this way, please suggest me any best way to optimize the code.
Hi…
I need not just find a string in a documentList.
There is a documentList and a string beneath it. The string contains an XML.
I am looping over the documentList and converting the XML string to document and then searching if the string exists in a particular node.
Now is there any way to directly search for a string without looping over the documentList.
No. Just like an array in Java, you need to visit each entry in the list separately.
One thing you might be able to do is instead of converting each string to a node and the node to an IS document, you can use XQL to do the search on the node. If you’re looking for the speediest technique, be sure to measure which is faster.