You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Simon Holmberg <ho...@gmail.com> on 2016/02/03 12:09:03 UTC

XSAttributeDeclaration::getConstraintValue returning 0

const XMLCh *XSAttributeDeclaration::getConstraintValue()
{
    if (fScope == XSConstants::SCOPE_GLOBAL)
        return fAttDef->getValue();

    return 0;
}

Why am I only allowed to get the constraint value of an attribute if this
"fScope" is global? In what context is an attribute EVER
global? XSAttributeDeclaration::getConstraintType returns
VALUE_CONSTRAINT_NONE because of the same kind of check, even though it
should be VALUE_CONSTRAINT_DEFAULT when the XSD I'm analyzing looks like
this:

<xs:complexType name="Component">
    <xs:attribute name="replicated" type="xs:boolean" default="false"/>
</xs:complexType>

If I change fAttDef to be public and read it directly, I
get fAttDef->getDefaultType == XMLAttDef::Default and fAttDef->getValue ==
"true" just like I expect...