Invalid Char in Text

E

Eileene Cordoves

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.
 
P

Peter Flynn

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
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top