If ‘strict’ and dfdl:textNumberRep is ‘standard’ then the data must follow the pattern with the exceptions that digits 0-9, decimal separator and exponent separator are always recognised and parsed.
IBM has an ongoing discussion with ICU in this area, I'll add this to the agenda.
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:
Mike Beckerle <mbeckerle.dfdl@gmail.com>
To:
dfdl-wg@ogf.org,
Date:
18/05/2013 19:49
Subject:
[DFDL-WG] examples
of decimal validation using pattern facet
Sent by:
dfdl-wg-bounces@ogf.org
Hello Mike,
Ø Can you send an example of the lat/lon validation
Ø you mentioned on yesterday's Daffodil call?
Here ya go:
<xsd:simpleType
name="foo">
<xsd:restriction
base="xsd:decimal">
<xsd:minInclusive
value="00"/>
<xsd:maxInclusive
value="59.9999"/>
<xsd:pattern
value="[0-9]{2}|[0-9]{2}\.[0-9]{1}|[0-9]{2}\.[0-9]{2}|[0-9]{2}\.[0-9]{3}|[0-9]{2}\.[0-9]{4}"/>
</xsd:restriction>
</xsd:simpleType>
/Roger
From: Mike Beckerle [mailto:mbeckerle.dfdl@gmail.com]
Sent: Thursday, May 16, 2013 8:15 AM
To: Costello, Roger L.
Subject: examples of decimal validation using pattern facet
Roger,
Can you send an example of the lat/lon validation you mentioned on yesterday's
Daffodil call?
The other members of the workgroup are wondering what can't be done via
totalDigits/fractionDigits, etc.
The rationale for why pattern facet is not supported on numbers in DFDL
is that we already have a much more powerful mechanism for parsing and
unparsing numbers called textNumberPattern. The pattern facet only allows
pass/fail using a regex, and is considered redundant (and problematic)
for numbers as a result.
...mike
--
Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology | www.tresys.com
--
Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology | www.tresys.com
--
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