Code: Alles auswählen.
name = node->get_name( ).
Code: Alles auswählen.
node ?= r_document.
CHECK NOT node IS INITIAL.
IF node IS INITIAL. EXIT. ENDIF.
* create a node iterator
iterator = node->create_iterator( ).
* get current node
node = iterator->get_next( ).
* loop over all nodes
WHILE NOT node IS INITIAL.
indent = node->get_height( ) * 2.
indent = indent + 20.
num_children = node->num_children( ).
CASE node->get_type( ).
WHEN if_ixml_node=>co_node_element.
* element node
name = node->get_name( ).
Code: Alles auswählen.
nodemap = node->get_attributes( ).
node_root = node->get_root( ).
name_root = node_root->get_name( ).
node_parent = node->get_parent( ).
name2 = node_parent->get_name( ).
IF NOT nodemap IS INITIAL.
* attributes
count = nodemap->get_length( ).
DO count TIMES.
index = sy-index - 1.
attr = nodemap->get_item( index ).
name = attr->get_name( ).
value = attr->get_value( ).
Code: Alles auswählen.
ENDDO.
ENDIF.
WHEN if_ixml_node=>co_node_text OR
if_ixml_node=>co_node_cdata_section.
* text node
value = node->get_value( ).
Code: Alles auswählen.
node_parent = node->get_parent( ).
name2 = node_parent->get_name( ).
ENDCASE.
* advance to next node
node = iterator->get_next( ).
ENDWHILE.