XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] RE: Abstraction in Science, Mathematics, Software, and Markup

I've been thinking a little bit about this type of thing lately.

My thoughts are that if you look at, say, a date type such as 2003-12-19,
you have actual values (such as the year 2003) and then some literal values
(such as -).

To mirror the xs:complexType and xs:simpleType in XSD I've been thinking a
good name for a construct that could express this would be xs:compoundType.

Within xs:compoundType I believe you could express the structure of
something like a date using the existing XSD model constructs such as
xs:sequence, xs:choice and xs:all.

For example, the date might be represented as:

<xs:compoundType name="date">
    <xs:sequence>
        <xs:value name='year' type='xs:int' format='04d'/>
        <xs:literal value='-'/>
        <xs:value name='month' format='02d'>
            <xs:simpleType>
                <xs:restriction base='xs:int'>
                    <xs:minInclusive value='1'/>
                    <xs:maxInclusive value='12'/>
                </xs:restriction>
            </xs:simpleType>
        </xs:value>
        <xs:literal value='-'/>
        <xs:value name='day' format='02d'>
            <xs:simpleType>
                <xs:restriction base='xs:int'>
                    <xs:minInclusive value='1'/>
                    <xs:maxInclusive value='31'/>
                </xs:restriction>
            </xs:simpleType>
        </xs:value>
    <xs:sequence>
<xs:compoundType>

The main additions are the xs:value and xs:literal elements and the format
attribute, which I've taken to be a simplified version of the Java and C
format specifiers.

Another example might be the duration type that would be along the lines of:

<xs:compoundType name='duration'>
    <xs:sequence>
        <xs:literal value='P'/>
        <xs:sequence minOccurs='0'>
            <xs:value='years' type='xs:unsignedInt'/>
            <xs:literal value='Y'/>
        </xs:sequence>
        <xs:sequence minOccurs='0'>
            <xs:value='months' type='xs:unsignedInt'/>
            <xs:literal value='M'/>
        </xs:sequence>
        <xs:sequence minOccurs='0'>
            <xs:value='days' type='xs:unsignedInt'/>
            <xs:literal value='D'/>
        </xs:sequence>
        <xs:sequence minOccurs='0'>
            <xs:literal value='T'/>
            <xs:sequence minOccurs='0'>
                <xs:value='hours' type='xs:unsignedInt'/>
                   <xs:literal value='H'/>
            </xs:sequence>
            <xs:sequence minOccurs='0'>
                <xs:value='minutes' type='xs:unsignedInt'/>
                <xs:literal value='M'/>
            </xs:sequence>
            <xs:sequence minOccurs='0'>
                <xs:value='seconds' type='unsignedFloat'/>
                <xs:literal value='M'/>
            </xs:sequence>
        </xs:sequence>
    </xs:sequence>
</xs:compoundType>

This is not an exact definition of duration, but hopefully it gives the
idea!  Also note that, unlike in regular XSD parsing, there are the
equivalent of UPA violations here (i.e. if you parse an integer, which value
does the integer belong to?).  Hence a back-tracking parser would be
required.

Where I see this sort of thing being useful is expressing things like GPS
coordinates or IP addresses in a single value.  I imagine that there are
other domains that have standard notations for what they do, but you
wouldn't want to create a single unified type system that incorporated all
the domain specific notations.

HTH,

Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using C++ XML
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info

----- Original Message ----- 
From: "Stephen D Green" <stephengreenubl@gmail.com>
To: "Costello, Roger L." <costello@mitre.org>
Cc: <xml-dev@lists.xml.org>
Sent: Sunday, March 13, 2011 10:40 AM
Subject: Re: [xml-dev] RE: Abstraction in Science, Mathematics, Software,
and Markup


>
> I realise, though, I might have to justify agreeing with
> extensions to WXS / XSD when I was only this month
> profering a slimmed-down 'MicroXSD'. Maybe there is
> a need for conformance profiles as seen in OWL - a 'lite'
> profile, a powerful-but-doable profile and a 'full' profile.
> The suggested extra abstraction feature of types without
> the agregation of concrete elements but with a more
> abstract agregation of other types (albeit some called
> 'crossProducts' - perhaps for backwards compatibility)
> might belong in either a powerful-but-doable profile or
> a 'full' profile depending on the difficulty of incorporating
> the feature into existing tools. [Perhaps something like
> 'MicroXSD' could then provide the 'lite' profile.]
>
> Best regards
>
> Stephen D Green
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
>





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS