Y
YuliaG
Hi,
I'm using SAX for XML parsing and inserting new elements (can't use
DOM).
I have a string that contains result of some "xml export to string",
for instance: "<a><b>xxxxxx</b></a>". I have to insert this string to
the file (as characters of some tag I'm adding) at a run time.
I tried:
Attributes attr = new AttributesImpl();
super.startElement(uri, "myData", "myData", attr);
String myData = "<a><b>xxxxxx</b></a>";
char[] myDataAsChars = myData.toCharArray();
super.characters(myDataAsChars ,0,myDataAsChars.length -1);
super.endElement(uri, "myData", "myData");
I need to get in file the following result:
<myData><a><b>xxxxxx</b></a></myData>
But, instead I get:
<myData><a><b<xxxxxx</b></a></myData>
How can I do this insertion correctly?
Thanks,
Yulia
I'm using SAX for XML parsing and inserting new elements (can't use
DOM).
I have a string that contains result of some "xml export to string",
for instance: "<a><b>xxxxxx</b></a>". I have to insert this string to
the file (as characters of some tag I'm adding) at a run time.
I tried:
Attributes attr = new AttributesImpl();
super.startElement(uri, "myData", "myData", attr);
String myData = "<a><b>xxxxxx</b></a>";
char[] myDataAsChars = myData.toCharArray();
super.characters(myDataAsChars ,0,myDataAsChars.length -1);
super.endElement(uri, "myData", "myData");
I need to get in file the following result:
<myData><a><b>xxxxxx</b></a></myData>
But, instead I get:
<myData><a><b<xxxxxx</b></a></myData>
How can I do this insertion correctly?
Thanks,
Yulia