I want to traverse through the entire nodes of an if_ixml_document. which is the best way to do this?
Please find the sample document.
<text>
<id>
<guid auto="false">
432543254543
</guid>
</id>
<title>
<short_title italics="on">
<bold language = "german">
"Hello"
</bold>
</short_title>
</title> </text>
In this document, i need to traverse through the nodes <text>, <id>, <guid> , <title>, <short_title>, <bold>
etc.
Thanks in advance
Regards, Alex
You can find an extensive XML manual on SAP's documentation website (in case the link doesn't work correctly, go to the NetWeaver Developer's Guide on help.sap.com and search for 'xml library').
The chapter 'iXML ABAP Objects Jumpstart' should get you started quickly. The paragraph 'Iterating over the complete DOM-tree' provides the following example code:
data: iterator type ref to if_ixml_node_iterator,
node type ref to if_ixml_node.
iterator = document->create_iterator( ).
node = iterator->get_next( ).
while not node is initial.
* do something with the node
...
node = iterator->get_next( ).
endwhile.