| When using a grammarpool the Saxparser will fail to resolve external entities. As soon as the grammar is cached the problem occurs. For my program it is essential that the grammar is cached because of performance issues. Another, but less important, problem comes when caching is on and you are editing a xml document with embedded DTD. MakingĀ changes in the internal subset becomeĀ inconsistent with the validation. But this can easily be avoided by turning off the grammarpool feature. Regards Dick Deneer |
note.dtd
Description: Binary data
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE note SYSTEM "note.dtd">
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>&props; Don't forget me this weekend!</body>
</note>
SaxParser2.java
Description: Binary data
I attach a test program with the xml and dtd I used. I got the following output: ===first time class SaxParser2$1 handleError Element type "to" must be declared. class SaxParser2$1 handleError Attribute "aaa" is required and must be specified for element type "heading". class SaxParser2$1 handleError The content of element type "note" must match "(toe,from,heading,body)". ===second time class SaxParser2$1 handleError Element type "to" must be declared. class SaxParser2$1 handleError Attribute "aaa" is required and must be specified for element type "heading". class SaxParser2$1 handleError The entity "props" was referenced, but not declared. class SaxParser2$1 handleError The content of element type "note" must match "(toe,from,heading,body)". |
