RE: ANN: Algorithm for Merging a simpleType Dependency Chain

Hi Mukul,

Recall the purpose of my algorithm: create a single, standalone rendering of a simpleType.

By sticking to the XML Schema representation of simpleTypes it is impossible to create a single, standalone rendering of a simpleType. Why? Because of the pattern facet - pattern facets within a simpleType are or-ed together whereas pattern facets across a dependency chain are and-ed together.

Therefore, I must create my own rendering. In my rendering all facets are and-ed together. Thus, I rendered enumeration facets as shown below (thanks for Michael Kay for this rendering of enumeration).

/Roger

-----Original Message-----
From: Mukul Gandhi [mailto:gandhi.mukul@gmail.com] 
Sent: Sunday, May 01, 2011 1:19 AM
To: Costello, Roger L.
Cc: xmlschema-dev@w3.org
Subject: Re: ANN: Algorithm for Merging a simpleType Dependency Chain

Hi Roger,
     Not commenting on the uses of your algorithm to merge constraints
of a simpleType dependency chain. This may have uses in certain use
cases.

There seems to be one technical gotcha, that I observed in your article.

Somewhere in your article, you say that simpleType is rendered as [1],

<xsd:simpleType name="Color">
     <xsd:restriction base="xsd:string">
         <xsd:enumeration>
             <xsd:value>red</xsd:value>
             <xsd:value>green</xsd:value>
             <xsd:value>blue</xsd:value>
         </xsd:enumeration>
     </xsd:restriction>
</xsd:simpleType>

This [1] doesn't have a valid XML representation of xsd:enumeration
(xsd:enumeration/{xsd:value}* is not a valid grammar of
xsd:enumeration. This needs to be somehow represented as
xsd:enumeration value="..", but the XSD valid form of xsd:enumeration
may be difficult to be used to implement your transformation of
xsd:enumeration).


On Sun, May 1, 2011 at 3:50 AM, Costello, Roger L. <costello@mitre.org> wrote:
> Hi Folks,
>
> An XML Schema simpleType can have a base type. And that base type may have a base type. And so on.  Further, the types may be in different schema files and in different namespaces.
>
> Determining the constraints on a simpleType in this "dependency chain" can be challenging.
>
> I created an algorithm for merging all the constraints in the dependency chain and rendering a single, standalone simpleType:
>
> http://www.xfront.com/XML-Schema-library/papers/Algorithm-for-Merging-a-simpleType-Dependency-Chain.pdf

>
> Comments welcome.
>
> /Roger




-- 
Regards,
Mukul Gandhi

Received on Sunday, 1 May 2011 09:15:49 UTC