W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2011

RE: What is this simpleType's "base" type?

From: Costello, Roger L. <costello@mitre.org>
Date: Mon, 20 Jun 2011 07:25:30 -0400
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <9E51F88D5247B648908850C35A3BBB500599AB3C22@IMCMBX3.MITRE.ORG>
Michael Kay wrote:

> In XSD 1.1 therefore the usage has been 
> changed so that "derived" means "derived by restriction": so saying "A 
> is derived from B" is the same as saying "B is the base type of A", and 
> the new term "constructed from" is used for the more general relationship.

Ah!

That's it.

Let's recap.

Consider this LotteryNumbers simpleType:

    <xsd:simpleType name="LotteryNumbers">
        <xsd:restriction>
            <xsd:simpleType>
                <xsd:list itemType="OneToNinetyNine"/>
            </xsd:simpleType>
            <xsd:length value="6"/>
        </xsd:restriction>
    </xsd:simpleType>

LotteryNumbers "base type" is the anonymous list simpleType: 

            <xsd:simpleType>
                <xsd:list itemType="OneToNinetyNine"/>
            </xsd:simpleType>

LotteryNumbers is "constructed from" the named OneToNintyNine simpleType:

    <xsd:simpleType name="OneToNinetyNine">
        <xsd:restriction base="xsd:positiveInteger">
            <xsd:maxInclusive value="99"/>
        </xsd:restriction>
    </xsd:simpleType>

Do you agree?

Thus, this function:

    base-type(LotteryNumbers)

returns

            <xsd:simpleType>
                <xsd:list itemType="OneToNinetyNine"/>
            </xsd:simpleType>

And this function:

     constructed-from(LotteryNumbers)

returns

    <xsd:simpleType name="OneToNinetyNine">
        <xsd:restriction base="xsd:positiveInteger">
            <xsd:maxInclusive value="99"/>
        </xsd:restriction>
    </xsd:simpleType>

Do those seem like reasonable function names for a standard XSD function library?

/Roger


Received on Monday, 20 June 2011 11:25:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 20 June 2011 11:25:59 GMT