Data Format Description Language (DFDL) v1.0 Specification
OGF Proposed Recommendation GFD-P-R.174, January 31, 2011
XSD element declarations and references can carry several attributes and properties that express constraints on the described data. These constraints are mainly use for validation but are also used by the dfdl:checkConstraints DFDL expression language function. These attributes and properties include:
The facets are:
The following sections describe these in more detail.
The xs:minOccurs value is used:
The xs:maxOccurs value is used:
It is a processing error when an array is found to have a number of occurrences not conforming to the xs:minOccurs constraints in the absence of a default value specification.
Note that specifically, this is not a validation error, it is a processing error. For example, if the array occurrences are delimited, we might be able to successfully separate them from each other and the surrounding data depending on the delimiter specifications; however, if the number of these occurrences is not conforming to the xs:minOccurs cardinality constraints then it is a processing error.
These facets are used:
When dfdl:lengthKind=”implicit”. In that case the length is given by the value of xs:maxLength. In this case minLength if specified is required to be equal to maxLength (schema definition error otherwise).
For validation of variable length string elements.
It is a processing error when a fixed-length string is found to have a number of characters not equal to the fixed number. For example, if a fixed-length string also has delimiters we might be able to successfully separate it from the surrounding elements depending on the delimiter specifications; however, if the length of the fixed-length string is not equal to the number specified as the fixed length then it is a processing error (not simply a validation error).
Used for validation only
The format of numbers is not derived from these facets. Rather dfdl properties are used to specify the format.
Allowed only on elements of type xs:string or derived from it.
Used for validation only
It is important to avoid confusion of the pattern facet with other uses of regular expressions that are needed in DFDL. For example, to determine the length of an element by regular expression matching.
Note: in XSD, pattern is about the lexical representation of the data, and since all is text there, everything has a lexical representation. In DFDL only strings are guaranteed to have a lexical and logical value that is identical.
Enumerations are used to provide a list of valid values in XSD.
Used for validation only
Note: in DFDL we do not use XSD enumeration as a means to define symbolic constants. These are captured using dfdl:defineVariable constructs so they can be referenced from expressions.
The 'default' attribute is used:
To provide the logical value of a required element while parsing when the element is missing. See 13.15 Nils and Default processing
To provide the logical value of a required element when unparsing when element is missing. See 13.15 Nils and Default processing
The 'fixed' attribute is used:
To constrain the logical value of an element when validating.
To provide the logical value of a required element while parsing when the element is missing. See 13.15 Nils and Default processing
To provide the logical value of a required element when unparsing when element is missing. See 13.15 Nils and Default processing
Copyright (C) Open Grid Forum (2005-2010). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the OGF or other organizations, except as needed for the purpose of developing Grid Recommendations in which case the procedures for copyrights defined in the OGF Document process must be followed, or as required to translate it into languages other than English.