I was able to port the NIST Java DOM test suite to JUnit and
then on to CppUnit for Xerces-C.  The source is in the CVS
of xmlconf.sourceforge.net (http://sourceforge.net/cvs/?group_id=8114)
but I haven't updated the site.
 
Running the tests resulted in three conformance errors.  One is a legitimate error, notation.getSystemId() always returns null, due to a pretty obvious bug in
DOMParser::notationDecl:
 
void DOMParser::notationDecl
(
    const   XMLNotationDecl&    notDecl
    , const bool                isIgnored
)
{
 NotationImpl* notation = ((DocumentImpl*)fDocument.fImpl)->createNotation(notDecl.getName());
 notation->setPublicId(notDecl.getPublicId());
- notation->setPublicId(notDecl.getPublicId());
+ notation->setSystemId(notDecl.getSystemId());
 
 fDocumentType->notations->setNamedItem( notation );
 
}
The other two conformance issues were with negative values for the count argument
of characterData.substringData() and characterData.deleteData().  The DOM spec
states that negative values for the count value should throw an INDEX_SIZE_ERR
exception.  In Xerces-C, the arguments are defined as unsigned int which results in
the negative values in the tests being interpreted as very large values.
 
In a perfect world, it would probably be best to remove the unsigned qualifiers from
the arguments so that the behavior would parallel that of the Java implementation.
 

Reply via email to