I have some sympathy with Mike's point,
and I suspect that this question will arise regularly, for exactly the
reasons that Mike has stated.
My recollection of the reasoning is
as follows:
- a DFDL processor needs to deal with
the representation and the logical values
- the representation is described by
DFDL properties ( some of which can be inherited from XSD properties via
the use of 'implicit' )
- the logical values are described/constrained
by xsd facets. These will only be checked if validation is enabled ( or
if the DFDL function dfdl:checkConstraints() is used in an assert/discriminator
).
- a pattern facet on an xs:string element
applies to the info set value.
- for a non-string element, it is not
possible to apply a pattern facet to the info set value
I think this issue could be overcome
if we made the rule that the pattern facet can only be used when representation='text'
and it is applied to the text representation, after any padding characters
have been removed.
Some questions would then arise:
- does this check occur before or after
nil processing?
- does a pattern of ".+,"
disallow empty elements, thus preventing defaulting even when a default
value has been supplied?
regards,
Tim Kimber, DFDL Team,
Hursley, UK
Internet: kimbert@uk.ibm.com
Tel. 01962-816742
Internal tel. 37246742
From:
Steve Hanson/UK/IBM@IBMGB
To:
Mike Beckerle <mbeckerle.dfdl@gmail.com>,
Cc:
dfdl-wg@ogf.org, dfdl-wg-bounces@ogf.org
Date:
16/05/2013 09:20
Subject:
Re: [DFDL-WG]
rationale for only allowing pattern facet on xs:string
type
Sent by:
dfdl-wg-bounces@ogf.org
It was to prevent confusion between
XML schema pattern facet and DFDL text number and text calendar patterns.
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: 15/05/2013
18:51
Subject: [DFDL-WG]
rationale for only allowing pattern facet on xs:string
type
Sent by: dfdl-wg-bounces@ogf.org
The pattern facet is allowed on all types in XML Schema.
DFDL says the XSDL pattern facet is for xs:string type elements only.
What is the rationale for this restriction?
We are encountering many constraints in format specs that are using XML
Schema regular expressions, where those regex are applied to numeric types
(e.g., xs:decimal for lattitude and longitude).
--
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--
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