‎2011 Feb 24 8:08 PM
Hello All,
anybody have a procedure to open a XML file and modify some os that tags and after save it at a local file or a server?
Best Regards,
Ricardo
‎2011 Feb 24 8:32 PM
Take a look at the ABAP-XML Transformation programs TCODE STRANS (lot of good blogs in SDN and SAP help)... You could transform the XML to internal table and then massage the data and transform it back to XML and save it to local file or server...
Or you can use PI to do the same;
‎2011 Feb 24 8:32 PM
Take a look at the ABAP-XML Transformation programs TCODE STRANS (lot of good blogs in SDN and SAP help)... You could transform the XML to internal table and then massage the data and transform it back to XML and save it to local file or server...
Or you can use PI to do the same;
‎2011 Feb 25 7:44 PM
Hello Kris,
this is the idea (to transform into internal table and modify data and after export to XML) but i didn't find anything that fits on this sittuation.
Anybody gives me another suggettion?
thanks,
Ricardo
‎2011 Feb 25 8:07 PM
Ricardo,
Take a look at this simple transformation example,
http://help.sap.com/abapdocu_70/en/ABENABAP_ST_EXAMPLE.htm
http://wiki.sdn.sap.com/wiki/display/Snippets/XMLXLStransformation
Last, but not least take a look at the blog series here in SDN.. He has a five part series for XML processing in ABAP...
/people/tobias.trapp/blog/2005/05/04/xml-processing-in-abap-part-1
‎2011 Feb 25 8:07 PM
You can either try parsing the XML, or use the Document Object Model. I think using the DOM would be the better approach.
The first thing you'll want to do is get XML document into a reference of type if_ixml_document.
Then you can use the document object model, which will allow you to get references of the XML document in object model represenation. For example, you can use references to types of if_ixml_node_collection, if_ixml_node_iterator, if_ixml_node, to update the model.
You can use the method if_ixml_document~render_2_string to write it back out to XML when you're done.