on 11-07-2005 6:59 AM
Hi All!!
I am struggling in transforming XML to be mapping target structures in using ABAP Mapping.
so i am on developing class with DOM.
i would like to know how many <person> derived from source xml, so what method should i use so that i can get that result. or does anyone idea how to work with multirecord to output XML?
data: incode1 type ref to if_ixml_node_collection,
incode2 type ref to if_ixml_node_collection,
get message content of tag <FirstName>
incode1 = idocument->get_elements_by_tag_name( 'FirstName' ).
incode2 = idocument->get_elements_by_tag_name( 'LastName' ).
<?xml version="1.0" encoding="UTF-8"?>
*Source XML
<ns:Personalinfo xmlns:ns="http://sap.com/test/ABAPMapping">
<person>
<FirstName>ABAP</FirstName>
<LastName>ITEM1</LastName>
</person>
<person>
<FirstName>ABAP</FirstName>
<LastName>ITEM2</LastName>
</person>
</ns:Personalinfo>
Message was edited by: Tony
Tony,
You need to use the method get_length. Try something like: -
*Get the list of child nodes
child_nodes = idocument->get_children( ).
*Get the number of children within child_nodes.
int = child_nodes->get_length( ).
Thanks
Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.