XMLParser error with unicode characters in XML file.

Discussion in 'XML' started by Manoj Nair, Jul 6, 2004.

  1. Manoj Nair

    Manoj Nair Guest

    I am getting a XML parsing error from weblogic.apache.xerces when I parse a XML
    document which contains accented characters.
    This is what I am doing

    1) Some database columns have accented data for spanish,japanese etc languages
    like Número de identificação: and número de identificación.

    2) I am reading this data and creating a XML file using some processing and
    then writing the file on the disc using weblogic.xml.stream.XMLOutputStream
    flush() method.

    3) Then I am using FOP to render this XML in PDF. In the rendering process
    the weblogic.apache.xerces.XMLparser gets called to parse the XML. Here the
    parser throws a org.xml.sax.SAXParserException ( An invalid XML character
    (Unicode: 0xfa) was found in the element content of the document).
    I was under the impression that XMLParser should take care of the accented
    characters. When I open the XML file which I created in XML SPY I see "box"
    characters like "cliente n? de identificaci".

    Please let me know how should i handle my code here.

    Thanks
    Manoj Nair, Jul 6, 2004
    #1
    1. Advertising

  2. In article <>,
    Manoj Nair <> wrote:

    % I am getting a XML parsing error from weblogic.apache.xerces when I parse a XML
    % document which contains accented characters.

    An example might be good. The problem is most likely that you're not
    specifying an encoding, and that your data is not encoded in utf-8.

    Try including an XML declaration:

    <?xml version='1.0' encoding='iso-8859-1'?>

    at the start of your XML files. This ought to work for the spanish data.
    You'll need to find out how the japanese data is encoded and either
    put that encoding in the XML declaration, or convert the data to UTF-8.

    --

    Patrick TJ McPhee
    East York Canada
    Patrick TJ McPhee, Jul 7, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bernd Oninger
    Replies:
    0
    Views:
    746
    Bernd Oninger
    Jun 9, 2004
  2. Markus Meckler
    Replies:
    0
    Views:
    352
    Markus Meckler
    Jun 12, 2004
  3. Fahad
    Replies:
    0
    Views:
    1,428
    Fahad
    Nov 16, 2005
  4. fierymustang

    SAX XMLParser Error

    fierymustang, Jan 21, 2006, in forum: Java
    Replies:
    1
    Views:
    334
  5. Grzegorz ¦liwiñski
    Replies:
    2
    Views:
    939
    Grzegorz ¦liwiñski
    Jan 19, 2011
Loading...

Share This Page