[DFDL-WG] Numbers with multiple ranges
Steve Hanson
smh at uk.ibm.com
Mon Mar 9 09:27:40 CDT 2009
That was what I was originally going to propose (more correctly any
annotations on members of the union are ignored) but it would mean the
scoping rules for simple types would be different when unions are
involved. I am ok with that if others are.
Regards
Steve Hanson
Programming Model Architect
WebSphere Message Brokers
Hursley, UK
Internet: smh at uk.ibm.com
Phone (+44)/(0) 1962-815848
Suman Kalia <kalia at ca.ibm.com>
09/03/2009 13:45
To
mbeckerle.dfdl at gmail.com
cc
dfdl-wg at ogf.org, dfdl-wg-bounces at ogf.org, Steve Hanson/UK/IBM at IBMGB
Subject
Re: [DFDL-WG] Numbers with multiple ranges
Mike - I see your point.. In this case, how about allowing DFDL
annotations only on the union and no DFDL annotations on the members of
the union.
Suman Kalia
IBM Toronto Lab
WMB Toolkit Architect and Development Lead
WebSphere Business Integration Application Connectivity Tools
http://www.ibm.com/developerworks/websphere/zones/businessintegration/wmb.html
Tel : 905-413-3923 T/L 969-3923
Fax : 905-413-4850 T/L 969-4850
Internet ID : kalia at ca.ibm.com
From:
"Mike Beckerle" <mbeckerle.dfdl at gmail.com>
To:
"'Steve Hanson'" <smh at uk.ibm.com>
Cc:
dfdl-wg at ogf.org
Date:
03/09/2009 09:38 AM
Subject:
Re: [DFDL-WG] Numbers with multiple ranges
But you can parse it.
If it's just the validation, you still have ambiguitities e.g., suppose I
form a union of two types, each derived from xs:int, but with different
DFDL representations. There's a conflict then, how is that resolved. Rules
for "consistency" among two DFDL annotations will be complex. E.g., is an
int with a 31 bit representation compatible wiht an int with 32 bit
representation? - shouldn't be unless both are unsigned. Etc.
...mike
Mike Beckerle | OGF DFDL WG Co-Chair | CTO | Oco, Inc.
Tel: 781-810-2100 | 100 Fifth Ave., 4th Floor, Waltham MA 02451 |
mbeckerle.dfdl at gmail.com
From: Steve Hanson [mailto:smh at uk.ibm.com]
Sent: Monday, March 09, 2009 4:46 AM
To: DFDL
Cc: dfdl-wg at ogf.org
Subject: Re: [DFDL-WG] Numbers with multiple ranges
It's a validation issue. I have a packed decimal number with ranges 0-100,
200-300, 400-500. I can't parse and validate this with DFDL. WTX can
handle this today.
Regards
Steve Hanson
Programming Model Architect
WebSphere Message Brokers
Hursley, UK
Internet: smh at uk.ibm.com
Phone (+44)/(0) 1962-815848
DFDL <mbeckerle.dfdl at gmail.com>
07/03/2009 04:49
To
Steve Hanson/UK/IBM at IBMGB
cc
"dfdl-wg at ogf.org" <dfdl-wg at ogf.org>
Subject
Re: [DFDL-WG] Numbers with multiple ranges
What does this have to do with representation/ format ?
Seems totally out of scope to me.
...mikeb
On Mar 6, 2009, at 12:18 PM, Steve Hanson <smh at uk.ibm.com> wrote:
One of the existing non-XML parsers from IBM is capable of modelling an
integer or decimal with non-contiguous ranges, eg, 0-100, 200-300,
400-500. It is also possible to model this using XML Schema, using a
user-defined simple type which is a union of simple type restrictions.
However it is not possible to model this in DFDL because unions are not
supported. A choice could be used, but that would give different named
elements in the resultant infoset depending on the value, which is not
ideal.
I believe this is use case that we should consider for DFDL 1.0. We could
decide to allow unions, but with a constraint that the members of the
union had to be restrictions of the same built-in type, and that clashing
DFDL properties on the members was an error. I believe the existing
scoping rules for visiting types would still apply ok. No annotation
appears on the xs:union only on the xs:simpleType as currently. The net
effect is that our parsing rules are the same as currently, but we gain
validation capability.
I am not in favour of more widespread support for unions. I don't have a
compelling use case for union of different logical types, eg, xs:dateTime
and xs:string.
Your thoughts are welcome.
!-- integer range 0 - 100
<xsd:simpleType name="intRange1">
<xsd:restriction base="xsd:int">
<xsd:maxInclusive value="100"/>
<xsd:minInclusive value="0"/>
</xsd:restriction>
</xsd:simpleType>
!-- integer range 200 - 300
<xsd:simpleType name="intRange2">
<xsd:restriction base="xsd:int">
<xsd:maxInclusive value="300"/>
<xsd:minInclusive value="200"/>
</xsd:restriction>
</xsd:simpleType>
!-- integer range 400-500
<xsd:simpleType name="intRange3">
<xsd:restriction base="xsd:int">
<xsd:maxInclusive value="500"/>
<xsd:minInclusive value="400"/>
</xsd:restriction>
</xsd:simpleType>
!-- Union of above types
<xsd:simpleType name="intRange">
<xsd:union memberTypes="intRange1 intRange2 intRange3"/>
</xsd:simpleType>
!-- Union of anonymous types being restrictions of above types
<xsd:simpleType name="intRangeLocal">
<xsd:union>
<xsd:simpleType>
<xsd:restriction base="intRange1"/>
</xsd:simpleType>
<xsd:simpleType>
<xsd:restriction base="intRange2"/>
</xsd:simpleType>
<xsd:simpleType>
<xsd:restriction base="intRange3"/>
</xsd:simpleType>
</xsd:union>
</xsd:simpleType>
!-- Union of anonymous types being local restrictions
<xsd:simpleType name="intRangeLocalRestrictions">
<xsd:union>
<xsd:simpleType>
<xsd:restriction base="xsd:int">
<xsd:minInclusive value="0"/>
<xsd:maxInclusive value="100"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType>
<xsd:restriction base="xsd:int">
<xsd:minInclusive value="200"/>
<xsd:maxInclusive value="300"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType>
<xsd:restriction base="xsd:int">
<xsd:minInclusive value="400"/>
<xsd:maxInclusive value="500"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:union>
</xsd:simpleType>
Regards
Steve Hanson
Programming Model Architect
WebSphere Message Brokers
Hursley, UK
Internet: smh at uk.ibm.com
Phone (+44)/(0) 1962-815848
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 at ogf.org
http://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 at ogf.org
http://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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ogf.org/pipermail/dfdl-wg/attachments/20090309/27dd1541/attachment-0001.html
More information about the dfdl-wg
mailing list