Invalid Char in Text

Discussion in 'XML' started by Eileene Cordoves, Dec 15, 2004.

  1. hi i'm a newbie in xml and we're using
    org.apache.xerces.parsers.SAXParser.
    anyone know what the invalid characters in xml are?

    one of the value in the parsed xml is '<space><space>1', we trimmed the
    whitespaces while constructing the xml and there are no errors.

    however, if it is not trimmed prior to xml construction, and we placed
    the trim function in character method such that:

    public void characters (
    char buf []
    , int offset
    , int len
    ) throws
    SAXException
    {
    String s = new String(buf, offset, len).trim();
    ......
    }


    i'm getting the error:
    oracle.xml.parser.v2.XMLParseException: Invalid char in text.
    at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:205)
    at
    oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingPars
    er.java:270)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:147)
    at org.xml.sax.helpers.ParserAdapter.parse(ParserAdapter.java:430)
    .....

    what's the diff bet the two ways of trimming spaces?

    in case helpful: the encoding specified in the xml header is UTF-8.

    any ideas?
    thanks in advance.

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Eileene Cordoves, Dec 15, 2004
    #1
    1. Advertising

  2. In article <41bfc9e3_2@127.0.0.1>,
    Eileene Cordoves <> wrote:
    >i'm getting the error:
    >oracle.xml.parser.v2.XMLParseException: Invalid char in text.


    You need to show us the XML that's getting parsed.

    -- Richard
     
    Richard Tobin, Dec 15, 2004
    #2
    1. Advertising

  3. Eileene Cordoves

    Peter Flynn Guest

    Eileene Cordoves wrote:

    > hi i'm a newbie in xml and we're using
    > org.apache.xerces.parsers.SAXParser.
    > anyone know what the invalid characters in xml are?


    Have you read the specification? It says explicitly what the allowed
    character are (all others are invalid).

    ///Peter
    --
    "The cat in the box is both a wave and a particle"
    -- Terry Pratchett, introducing quantum physics in _The Authentic Cat_
     
    Peter Flynn, Dec 18, 2004
    #3
    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. wwj
    Replies:
    7
    Views:
    558
  2. Tim Johansson
    Replies:
    15
    Views:
    8,377
    Christopher Benson-Manica
    Apr 8, 2004
  3. wwj
    Replies:
    24
    Views:
    2,521
    Mike Wahler
    Nov 7, 2003
  4. spoilsport
    Replies:
    5
    Views:
    3,842
    BartenderSam
    Mar 4, 2004
  5. lovecreatesbeauty
    Replies:
    1
    Views:
    1,062
    Ian Collins
    May 9, 2006
Loading...

Share This Page