hi all,

im currently writting an xml file that i create using xerces-2 via :

        new XMLSerializer(new FileWriter(new File(fileName)), new
OutputFormat("xml", "UTF-8", false)).serialize(mainElement);

but when i try to read it back in using xerces-2, i get a fatal error
followed by an exception printstack as such:

[Fatal Error] doc\seen.xml:2:3685: Character reference "&#f" is an invalid
XML character.
org.xml.sax.SAXException: Character reference "&#f" is an invalid XML
character.
        at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:218)
        at
org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:20
0)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:170)
        at booboo.xml.XMLHelper.parseXML(XMLHelper.java:20)
        at booboo.xml.MultipleNodeXMLizer.loadState(MultipleNodeXMLizer.java:37)

i looked up the character in question and its not allowed in xml files.
knowing this, i assumed that xerces would do one of the following:
        - switch the character with another sequence and switch it back when i read
the file back in
        - throw an exception while creating the document since xerces just got
asked to create an invalid xml document.

neither of these happens and the receiving end is the one thats breaking.
could someone tell me how i can send that particular character using an xml
format? will i have to base64 encode my data?

thanks for your help,

-saad.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to