The checkConstraints() function will check against the XSDL fixed attribute. It won't check the XSDL default, minOccurs or maxOccurs attributes.

Regards

Steve Hanson
Architect, IBM Data Format Description Language (DFDL)
Co-Chair,
OGF DFDL Working Group
IBM SWG, Hursley, UK

smh@uk.ibm.com
tel:+44-1962-815848




From:        "Garriss Jr., James P." <jgarriss@mitre.org>
To:        "dfdl-wg@ogf.org" <dfdl-wg@ogf.org>,
Date:        07/06/2013 15:03
Subject:        [DFDL-WG] of check constraints and fixed
Sent by:        dfdl-wg-bounces@ogf.org




Check constraints can be used…
 
                        <xsd:annotation>
                                   
<xsd:appinfo source="http://www.ogf.org/dfdl/dfdl-1.0/">
                                               
<dfdl:assert test="{ dfdl:checkConstraints(.) }" message="There cannot be more than 59 seconds in a minute."/>
                                   
</xsd:appinfo>
                       
</xsd:annotation>
 
…to validate (while parsing) the restrictions placed on an element:
 
                        <xsd:simpleType>
                                   
<xsd:restriction base="xsd:unsignedInt">
                                               
<xsd:maxInclusive value="59"/>
                                   
</xsd:restriction>
                       
</xsd:simpleType>
 
Is check constraints similarly required to validate the fixed value of an element while parsing?
 
<xsd:element name="MimeVersion" dfdl:initiator="MIME-Version:%SP;" dfdl:terminator="%NL;" type="xsd:string" dfdl:length="3" dfdl:lengthKind="explicit" fixed="1.0">
 
If not, then how do I force it to validate while parsing?
 
TIA--
 dfdl-wg mailing list
 dfdl-wg@ogf.org
 
https://www.ogf.org/mailman/listinfo/dfdl-wg

Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU