Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Parser to solve XHTML errors?

843834Feb 19 2004 — edited Feb 19 2004
Hi,

I have a fairly complex problem to describe with Xerces-J 2.5.0. I'll try to make it simple.

My goal is to parse XHTML files. I parse them ok but my issues are with not compliant XHTML files such as the ones with <input ...> instead of <input .../>.

I have rebuilt the Xerces library in eclipse.

I have made a small test in a test environment, and it looks like Xerces is able to correct such xml errors. I was surprised. However, some features are failing to be set such as http://apache.org/xml/features/validation/schema/augment-psvi, http://xml.org/sax/features/external-general-entities...

But the parse process is running ok. And it solves my XHTML mistakes...

Now, when I use this Xerces jar in Tomcat (I have removed all other reference to any XML parser), the features are set correctly but the document fails to be parsed.

I simply do not understand why it is different in the command line and in tomcat. I use an explicit call to create a new org.apache.xerces.parsers.DOMParser:
      parser = new org.apache.xerces.parsers.DOMParser();
When I use a library from the binary distribution (2.4.0, 2.5.0 and 2.6.1) it fails in both cases.

Is there some Sun XML parser that is overriding my use of Xerces (like the built-in version of Xalan)?

Is there a way to know the location of the JAR files the program is using? I am pretty sure that I am using the right classpath (otherwise it fails) but who knows...

Any help / hint will be really appreciated...

TIA
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 18 2004
Added on Feb 19 2004
2 comments
286 views