• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 398
  • 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?
0
ruff_ryder
Asked:
ruff_ryder
  • 2
1 Solution
 
Choli100298Commented:
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.

choli
0
 
Wayne BradneyIndependent ConsultantCommented:
ruff_ryder,

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

Regards,
WMB
0
 
ruff_ryderAuthor Commented:
Thanks guys, fixed it. Used:

parser->setExitOnFirstFatalError(false);

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 ...
0
 
Choli100298Commented:
thanx ;-)

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

choli
0
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

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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