[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Classpathx-xml] bug in aelfred parser?

From: Maarten Coene
Subject: [Classpathx-xml] bug in aelfred parser?
Date: Wed, 04 Aug 2004 13:30:22 +0200
User-agent: Mozilla Thunderbird 0.7.2 (Windows/20040707)


I'm having a problem with the latest sources of the Aelfred parser. I cannot parse this peace of xml:

<root attr="Hello There &lt;&gt;&amp;" />

For instance, the following code throws an exception:
   public void testAmp() throws Exception {
       String xml = "<root attr=\"Hello There &lt;&gt;&amp;\" />";
       InputStream in = new ByteArrayInputStream(xml.getBytes());
SAXParserFactory factory = new JAXPFactory();
       factory.newSAXParser().parse(in, new DefaultHandler());

the exception is:
org.xml.sax.SAXParseException: & must be encoded either as &amp; or as &#38;#38
   at gnu.xml.aelfred2.SAXDriver.fatal(
   at gnu.xml.aelfred2.XmlParser.error(
   at gnu.xml.aelfred2.XmlParser.readLiteral(
   at gnu.xml.aelfred2.XmlParser.parseAttribute(
   at gnu.xml.aelfred2.XmlParser.parseElement(
   at gnu.xml.aelfred2.XmlParser.parseDocument(
   at gnu.xml.aelfred2.XmlParser.doParse(
   at gnu.xml.aelfred2.SAXDriver.parse(
   at gnu.xml.aelfred2.XmlReader.parse(
   at javax.xml.parsers.SAXParser.parse(Unknown Source)
   at javax.xml.parsers.SAXParser.parse(Unknown Source)

This problem is introduced recently, with older Aelfred code (3 months old), I didn't have the problem...

Is there something wrong with the aelfred code, or is there a problem with my xml document?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]