• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 396
  • Last Modified:

SAX Parser and DTD

Hello all, I'm using Apache's Xerces-C 1.4 to write a validating parser for my app. The validation works, but my prob is that if the xml file is not in valid format the parser stops at the very first invalid section.

I want to collect all the invalid points in the XML document and report them at the end of the parse of the entire document!

Any hints?
  • 2
1 Solution
Maybe, yes....

take a look at O`Reilly - homepage. In the sampels for the book Java and XML (Download from http://examples.oreilly.com/javaxml/)

they show how to implement an own error-handler (chapter 3 or so....). With this sample, you should be able to handle your problem.

Wayne BradneyIndependent ConsultantCommented:

The parser should report all errors. What is your handler doing?

ruff_ryderAuthor Commented:
Thanks guys, fixed it. Used:


wbrandey, my Handler implements the ErrorHandler and DocumentHandler interfaces. What I want to do is to create a report of the parse process and see what it encountered during the parse so I'm capturing all errors and examining the elements for attributes and stuff ...

Choli, the points are yours ...
thanx ;-)

first expert points in my life.... I'll keep you in mind 4 all my life... ;-)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now