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

XML Schema programming idiom: gathering up all the constraints on a simpleType

From: Costello, Roger L. <costello@mitre.org>
Date: Wed, 27 Apr 2011 05:41:20 -0400
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <9E51F88D5247B648908850C35A3BBB50053922F423@IMCMBX3.MITRE.ORG>
Hi Folks,

One activity that I frequently perform when processing XML Schemas is this:

     I have a simpleType and I need to know 
     all the constraints on it.

Example: consider this simpleType:

    <xsd:simpleType name="BostonAreaSurfaceElevation">
        <xsd:restriction base="elev:EarthSurfaceElevation">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="120"/>

What are all the constraints on it? Well, it identifies a base type, elev:EarthSurfaceElevation. That base type may contain some constraints that must be considered. Further, that base type may have a base type, which has a base type, etc. That entire dependency tree must be considered.

Determining all the constraints on a simpleType is an important programming idiom (at least, it is for my applications).

What would you name this programming idiom? I have been naming it "simpleType accumulated restrictions" but wonder if there is a better name? 

Even better, is there a functional programming language (e.g., Haskell) function that does this kind of activity, or an analogous activity?

Received on Wednesday, 27 April 2011 09:41:48 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:19 UTC