Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parser Question

Status
Not open for further replies.

rhull

Programmer
May 23, 2001
46
US
Is it possible for a parser (DOM or SAX) to continue to read the whole XML doc even after it has encountered the first error. Let say I have the last name tag wrong and also the work phone. Would I have to reconfigure the parser to continue? I would bascially want to map out all the errors at once, not just one at a time.

<servicelevel>ServiceLevel</servicelevel>
<name>
<first>first</first>
<lasttt></last>

</name>
<phone>
<work>9999999999</work>
<hm>9999999999</home>
</phone>

-Thanks
-Ryan
 
I'm not too sure about SAX.


But a DOM, should be able to parse the whole document
unless your error handling dictates otherwise.
 
Hi,

a DOM parser loads the entire document into the standard tree on the load event and will therefore fall over if the xml document is not well formed. The SAX parser (I think as I don't use this that often) only loads the sections of the document as it needs them. therefore I would think that will only get an error when you load the section that has the error in it

I hope this is of some use

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top