Proposal for the ISO character entity bug in gnujaxp
Arnaud Vandyck <[email protected]>
| Newsgroups | gmane.comp.java.classpath.extensions.xml |
|---|---|
| Organization | STE-FI, ULg |
| Message-ID | <[email protected]> |
Hi everybody, hi Nic, Looking at you problem with your xml fragment <http://mail.gnu.org/pipermail/classpathx-xml/2002-May/000125.html>, I did some tests to find where is the bug. First, I created a test class to show the nodes of a document with DOM. I also did an xml file near yours and I saw you were working with DocBook for xml (SimpleDocbook if I recall). I did some tests and found that the problem was when parsing the ISO character entity of Docbook (for example: <!ENTITY euro "€">). I did change the call of the readLiteral(int) method in the parseEntityDecl() method in the gnu.xml.aelfred2.XmlParser class. This call is to get the value of an entity if I did understant the code correctly. But it passes the value '0'. I did change it to value LIT_DISABLE_CREF (this is an integer, the value is 16). Looking in other methods, I saw the developers use an 'int flags=LIT_DISABLE_...' line. I did the same in the parseEntityDecl() method. I do not know if this will not cause any other problems and I suggest everyone who can to look at the patch before committing the changes... maybe someone can forward this mail to one of the author or both (David Megginson <[email protected]>, David Brownell <[email protected]>) to be sure the patch is correct. Please boys, be indulgent for my first patch ever! :-) If I gave to many descriptions (too verboze?), if the patch format is not good, if there is a problem, let me know. If my english is not very good, well, don't let me know, I already do :-) These commands patch the good file: # cd jaxp_root # patch -p1 < ../jaxp-char-entities-patch-20021012.diff This is also the first time I use the diff and patch commands! I hope this helps, have a nice day/night :-) PS: I also attached a Test.java and a test.xml files. You'll have to change the dtd location, I used the docbook xml v4.2 for the test. -- arnaud :: http://vbstefi60.fapse.ulg.ac.be/~arnaud/
jaxp-char-entities-patch-20021012.diff
(text/plain, 0 B)
Test.java
(text/plain, 0 B)
test.xml
(text/plain, 0 B)