Quantcast
Channel: How to encode characters from Oracle to XML? - Stack Overflow
Viewing all articles
Browse latest Browse all 4

How to encode characters from Oracle to XML?

$
0
0

In my environment here I use Java to serialize the result set to XML.It happens basically like this:

//foreach column of each rowxmlHandler.startElement(uri, lname, "column", attributes);String chars = rs.getString(i);xmlHandler.characters(chars.toCharArray(), 0, chars.length());xmlHandler.endElement(uri, lname, "column");

The XML looks like this in Firefox:

<row num="69004"><column num="1">10069</column><column num="2">sd&#26;</column><column num="3">FCVolume                      </column></row>

But when I parse the XML I get the a

org.xml.sax.SAXParseException: Character reference "&#26" is an invalid XML character.

My question now is: Which charactes do I have to replace or how do I have to encode my characters, that they will be valid XML?


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images