This seems to be a bug either in the code or the design of the -i feature in
XmlGrammarBuilder.

The problem is that when the parser looks for a declared entity with name "copy" the Hashtable
has no entities of such name. ( this happens in the org.apache.impl.XMLEntityManager classe, method
isDeclaredEntity).


So the bug is:
"XxmlGrammarBuilder can not validated instance documents using a DTD which defines internal ( same bug may occurr with external ) general entities" ( if the bug is not in bugzilla somebody should
open a bug report).



I have not look into the code but maybe the Grammar does not keep a list of entities therefore when
using it against a document instance it will fail when trying to resolve the entity. I hope this is not
the case because that may indicate a flaw on the Grammar building/caching mechanism.


Any comments?

                 Jeffrey Rodriguez
                 Silicon Valley


From: "Roskowetz, Thorsten (empolis GT)" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject: Grammar-Caching and Entities - possible bug?
Date: Mon, 15 Sep 2003 15:05:37 +0200

Hi!

I seem to have found a strange behaviour in Xerces-J 2.5.0 while
experimenting with the xni-sample XmlGrammarBuilder.  Here is my
simple test data:

1. the DTD:

<!ENTITY copy "�" >
<!ELEMENT deliverable (#PCDATA) >

2. a sample instance document:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE deliverable SYSTEM "test.dtd">
<deliverable>&copy;</deliverable>

When I call XmlGrammarBuilder like this:

C:\>java -cp
s:\rossi\xerces-2_5_0\xercesImpl.jar;s:\rossi\xerces-2_5_0\xercesSamples.jar
xni.XMLGrammarBuilder -d c:/test.dtd -i c:/test.xml

I get the following result:

[Error] test.xml:3:20: The entity "copy" was referenced, but not declared.

Looks like Xerces does not "store" information about the &copy; entity in
its preparsed grammar pool.  After browsing the mailing lists it appears
as if this "feature" comes up from time to time with no satisfying answer.
The latest thread "XMLGrammarPreparser question" seems to be related
somewhat,
but my test case is much simpler and I have trouble to understand how
grammar
caching could possibly be useful if such a simple test case won't work.

Maybe I'm misunderstanding something important here?

Best regards,
Thorsten

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
Send and receive larger attachments with Hotmail Extra Storage. http://join.msn.com/?PAGE=features/es



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to