xml string in element

View: New views
2 Messages — Rating Filter:   Alert me  

xml string in element

by sjohn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I have basic question regarding adding xml within xml.

  String xml = "<call:Status>open</call:Status>";
 
and one elem that I am adding in existing doc.
 
   Element elem = new Element("Test");

when I add
 
       elem.addContent(xml);


The doc has elem like
    <Test><call:Status>open</call:Status></call:CpoData>

with less than, greater than and all xml tags in xslt format.

I also tried   XmlObject  xo = XmlObject.Factory.parse(xml);  and add xo.xmlText(); also elem.text(xml);
but same result.

Can anyone guide me here please?


Re: xml string in element

by sjohn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

looks like my above string got converted

here it is ..

<Test>"amp less than char semicolon" call:Status "amp less than char semicolon"open"amp less than char semicolon"/call:Status"amp less than char semicolon"</call:CpoData>

xslt format amp lt ;  and amp gt;