‎2011 Jul 18 1:07 PM
In my program , I am reading am XML string and i want to delete all the occurences of the XML tag below:
<desc>
<text xmlns:xft-xliff="http://www.xfa.org/schema/xfa-xliff/1.0/" name="Schema Annotation" xft-xliff:id="N897">d3153e10ea5711dac5bb001279d7d2c2</text>
</desc>
I tried to write the below way but it doesn't work .
REPLACE ALL OCCURRENCES OF '<desc>
\<[[:alnum:]]+\> <desc>' IN cp_xml_string WITH ' 'IGNORING CASE.
Please provide any input.
Thanks,
Sri
‎2011 Jul 18 2:51 PM
Hi,
If it's an xstring, you could try to convert it into a DOM...
CALL FUNCTION 'SDIXML_XML_TO_DOM'
EXPORTING
xml = lv_serializied_stream
IMPORTING
document = lo_if_xml_document
EXCEPTIONS
invalid_input = 1
OTHERS = 2....and then navigate down where required and work with "IF_IXML_NODEREMOVE_NODE" and "IF_IXML_NODEREMOVE_CHILD". I'm not sure whether you can use this, because I'm not aware of the dynamics and complexity of your XML stream, but this sure would be a possibility in general.
regards, Lukas