TDOMParser does not return negative values on failed parsing

Greetings,

I use TDOMParser::ParseFile to parse an XML file with inline DTD, but when a validation fails it does not return negative numbers as I expect.

I have attached two XML files, good.txt and bad.txt, to demonstrate this effect.

In ROOT, I do

root [0] TDOMParser* domp = new TDOMParser()
root [1] domp->ParseFile("good.txt")        
(Int_t)(0)
root [2] domp->GetParseCode()               
(const Int_t)(0)
root [3] domp->ParseFile("bad.txt")         
bad.txt:10: element middlename: validity error : No declaration for element middlename
<middlename>Thomas</middlename>
                               ^
bad.txt:11: element person: validity error : Element person content does not follow the DTD, expecting (surname , firstname), got (surname firstname middlename )
</person>
         ^
(Int_t)(0)
root [4] domp->GetParseCode()       
(const Int_t)(0)

This example was made in pre-compiled 5.18/00 on a Mac, but I have produced this effect on Linux as well in pre-compiled versions as low as v5.14/00e. Am I incorrectly using the TDOMParser, or going about XML validation the wrong way?

Thanks,

Jake
bad.txt (266 Bytes)
good.txt (234 Bytes)

Hi Jake,

this is now fixed in the svn trunk. The TDOMParser only checked if the document was wellformed (which bad.txt is) but not if it was valid (which bad.txt is not).

Cheers, Fons.