Note: this message has been forwarded to both the xerces-dev and
xerces-dev-c mailing lists

Using Xerces C, DocumentImpl.cpp Revision 1.11 2000/03/02

Both of the DocumentImpl constructors assign DocumentImpl::docType to NULL
which, in turn, means that DocumentImpl::getDoctype() always returns NULL.
 I'm suspicious of the following constructor, in which a DocumentTypeImpl*
object is passed in [note: I have slightly modified the following fragment
for clarity]:

//DOM Level 2
DocumentImpl::DocumentImpl(
        const DOMString &fNamespaceURI,
        const DOMString &qualifiedName, 
        DocumentTypeImpl *doctype)
    : NodeImpl(null, DStringPool::getStaticString("#document", &nam),
DOM_Node::DOCUMENT_NODE, false, null)
{
    if (doctype != null && doctype->getOwnerDocument() != null)
        throw DOM_DOMException( //one doctype can belong to only one
DocumentImpl
            DOM_DOMException::WRONG_DOCUMENT_ERR, null
        );
    docType=null;
    if (doctype != null) {
        doctype -> setOwnerDocument(this);
        appendChild(doctype);
        doctype -> referenced();        
        // ??? docType = doctype; ???? Shouldn't this be assigned here?
    }
   [snipped to save space]
}

Shouldn't SVGDocumentImpl::docType be assigned doctype in this code block
where indicated by the ??? comment above?  There doesn't seem to be any
other way to assign to DocumentImpl::docType.  

S.




Reply via email to