I did some serious debugging and have tracked my problem down to the
document cloning process. Everything looks dandy until then except that I
can not access the default attributes but at least they are there in
DOMElementImpl::fDefaultAttributes.
So I modified some fuctions to be able to access the default values.

*************************************************************************
const XMLCh * DOMElementImpl::getAttribute(const XMLCh *nam) const
{
    static const XMLCh emptyString[]  = {0};
    DOMNode * attr=0;

    attr=fAttributes->getNamedItem(nam);

    if (!attr && fAttributes->hasDefaults())
      attr=fDefaultAttributes->getNamedItem(nam);

    const XMLCh *retString = emptyString;
    if (attr != 0)
        retString = attr->getNodeValue();

    return retString;
};
*************************************************************************
DOMAttr *DOMElementImpl::getAttributeNode(const XMLCh *nam) const
{
    DOMNode * attr=0;
    attr=fAttributes->getNamedItem(nam);
    if (!attr && fAttributes->hasDefaults())
      attr=fDefaultAttributes->getNamedItem(nam);
    return  (DOMAttr*) attr;
};
*************************************************************************

I'm not sure how the DOM API is supposed to work with default values.
Should getAttributes also return default value attributes?
If it should, then the solution needs to be modified a bit.

I came to realize that a document clone totally removes all default values.
How it is supposed to work?
Personally I found the new handy function adoptDocument() in the parser so I
do not sweat about the cloning problem anymore ( plus that I saved tons of
CPU cykles. YES! :o) )

Regards
Erik Rydgren


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to