classpathx-xml
[Top][All Lists]
Advanced

[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)

Hi,

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(SAXDriver.java:985)
   at gnu.xml.aelfred2.XmlParser.error(XmlParser.java:392)
   at gnu.xml.aelfred2.XmlParser.readLiteral(XmlParser.java:2535)
   at gnu.xml.aelfred2.XmlParser.parseAttribute(XmlParser.java:1110)
   at gnu.xml.aelfred2.XmlParser.parseElement(XmlParser.java:1035)
   at gnu.xml.aelfred2.XmlParser.parseDocument(XmlParser.java:417)
   at gnu.xml.aelfred2.XmlParser.doParse(XmlParser.java:165)
   at gnu.xml.aelfred2.SAXDriver.parse(SAXDriver.java:346)
   at gnu.xml.aelfred2.XmlReader.parse(XmlReader.java:299)
   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?

regards,
Maarten






reply via email to

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