2006 Jul 13 11:09 AM
Hello,
first of all I don't know much about xml, but I want to extract data from an xml file at a given path.
E.g.
<Human>
<Employee>
<Name>John Doe</Name>
<Phone>+32486448800</Phone>
</Employee>
<Employee>
...
</Employee>
</Human>
So, the user enters the path '/Human/Eployee/Name/' in an input field, the value 'John Doe' in an other input field
and for example ./phone in an other input field. I have to extract the phone number, how would this best be done? I managed to get my file in a if_ixml_document. I've been looking for a method to obtain all '/Human/Eployee/Name/'-nodes, but until now, I haven't found such a thing. Does it exist or do I have to create a complex filter? Thanks.
2006 Jul 13 11:13 AM
Hi,
Try this
Function module: SCMS_STRING_TO_FTEXT.It moves XML data into itab.
Reward points if helpful
Message was edited by: amit teja
2006 Jul 20 10:29 AM
Well, I made quite a strange workaround.
I loaded the xml in a ixml_document and I put the search path in a table.
I made a filter who searched for the last node in the path, so in the above example that would be 'Name'. If a name node was found, I checked if it was the right one, by looping through the table and comparing it with the node->get_parent method.
I think there must be better ways, but this works and that's all I need atm.