Code:

                        domParser.setFeature(“http://apache.org/xml/features/validation/schema”, false);

                        domParser.setFeature(“http://apache.org/xml/features/dom/create-entity-ref-nodes”, false);

 

With this configuration, and using Xerces 2.2.1, anytime the parser encounters an entity that is not defined in the DTD, we get the following results:

Input:                properly elected to do so, can amend its &bogus; Federal income tax returns filed

Output:             Federal income tax returns filed

 

Ran a test with a newer version of Xerces (2.6.0) and got a slightly different result:

Input:                properly elected to do so, can amend its &bogus; Federal income tax returns filed

Output:             properly elected to do so, can amend its  Federal income tax returns filed

 

In either case, this is not a good thing.

 

I am looking for method that would allow me to keep the above features set the way they are, but code a method that would allow me identify an undefined entity in the data.

 

I am also curious why the Xerces code would not throw an exception when the above data is encountered. I am will to go to 2.8.0 Xerces if this problem was addressed.

 

Let me re-state, I want the code to throw an exception!!!!

 

Please let me know if there are any questions.

 

Dave

 

David B. Crain
Consultant Software Engineer
Editorial & Conversion Systems
Lexis-Nexis
Phone: 937-865-6800 ext. 56303

 

Reply via email to