Hi,

Given the schema below, with Xerces schema API, having
access to XSDateTime representing the fixed value for
the attribute use, getLexicalValue method returns
"2003-04-24" instead of "2003-04-25+09:00".

I found that, if I changed the order of the checkings that
are done in checkDefaultValid method of  org.apache.xerces.
impl.xs.traversers.XSDAttributeTraverser class as follows,
I get "2003-04-25+09:00".

    // throws an error if the constraint value is invalid for the given type
    void checkDefaultValid(XSAttributeUseImpl attrUse) throws 
InvalidDatatypeValueException {
        // validate the canonical lexical rep
        
((XSSimpleType)attrUse.fAttrDecl.getTypeDefinition()).validate(attrUse.fDefault.stringValue(),
 fValidationState,
attrUse.fDefault);
        // validate the original lexical rep, and set the actual value
        
((XSSimpleType)attrUse.fAttrDecl.getTypeDefinition()).validate(attrUse.fDefault.normalizedValue,
 fValidationState,
attrUse.fDefault);
    }

Regards,

-taki


<xsd:schema targetNamespace="urn:foo"
           xmlns:xsd="http://www.w3.org/2001/XMLSchema";
           xmlns:foo="urn:foo" >

<xsd:attribute name="date" type="xsd:date" />

<xsd:complexType name="date">
  <xsd:attribute ref="foo:date" fixed="2003-04-25+09:00" />
</xsd:complexType>

</xsd:schema>


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

Reply via email to