RE: ANN: Algorithm for Merging a simpleType Dependency Chain

"Costello, Roger L." <[email protected]>
Newsgroups gmane.text.xml.schema.devel
Message-ID <[email protected]>
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:[email protected]] 
Sent: Sunday, May 01, 2011 1:19 AM
To: Costello, Roger L.
Cc: [email protected]
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. <[email protected]> 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
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.