Hi,

 

I encounter a problem when I using the cloneElement function, the CDATA
will be lost after the clone operation, for example:

 

My xml message is:

 

<?xml version='1.0' encoding='utf-8'?>

<map>

<name>FOTO</name>

<cdata><![CDATA[<aaa>]]></cdata>

</map>

 

After I using the cloneElement function, the clone message I got become:

 

<?xml version='1.0' encoding='utf-8'?>

<map>

<name>FOTO</name>

<cdata><![CDATA[]]></cdata>

</map>

 

Could you help to look at this? The codes I using is like below:

 

    InputStream inputStream   =   new ByteArrayInputStream(xmlMessage);

    XMLStreamReader parser =
XMLInputFactory.newInstance().createXMLStreamReader(inputStream);

    StAXBuilder builder = new StAXOMBuilder(parser);

OMDocument document = builder.getDocument();

 

OMElement documentElement = document.getOMDocumentElement();

documentElement.build();

 

OMElement cloneElement = documentElement.cloneOMElement();

 

Thanks & Regards!

 

Zhi Hao

 

Reply via email to