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

"Costello, Roger L." <[email protected]>
Newsgroups gmane.text.xml.schema.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.