Invalid Char in Text

Eileene Cordoves

Usenet Archive
Joined
Dec 15, 2004
Messages
1
Reaction score
0
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.
 

Peter Flynn

Usenet Archive
Joined
Jan 2, 2000
Messages
1,813
Reaction score
0
Eileene said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,802
Members
249,594
Latest member
henrywalsh

Latest Threads

Top