Hello DFDL community,
Do you agree with the following?
DFDL is a parsing language, not a validation language.
While it is possible to do validation in DFDL, it is not recommended. That is,
it is possible to design a DFDL schema to validate data as the data is being
parsed, but that is not recommended.
Instead, use DFDL just for parsing. Once input data has been converted to XML,
bring to bear all the XML tools to process the XML, including validation tools
such as XML Schema, Schematron, and/or RelaxNG. That is, do validation on the
XML, not on the native file format.
But you might argue: Hold on there, in the most recent discussion wasn't
validation performed in the DFDL schema:
<xs:sequence>
<xs:element name="value" type="xs:string"
dfdl:lengthKind="pattern"
dfdl:lengthPattern=".*?(?=(\x0D-|\x0D\x0A-|-|\)$))">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/">
<!-- Isn't the following validation? -->
<dfdl:assert message="empty value" >
{fn:string-length(.) gt 0}
</dfdl:assert>
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:choice>
...
</xs:choice>
</xs:sequence>
That validates the length of the input is greater than zero, yes?
Yes. However, it is being used strictly for signaling to Daffodil when to
abandon this sequence, back up, and proceed down the next path. In other words,
it is being strictly used as a parsing device, not a validation device. [Am I
expressing this correctly? Is there a better, richer, more correct way to
express this?]
/Roger