[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XML schema cos-nonambig problem
> <define name="contentiddef"> > <choice> > <interleave> > <optional> > <element name="major" ns="http://www.polopoly.com/polopoly/ > cm/app/xml"> > <choice> > <text/> > <data type="integer"/> > </choice> > </element> > </optional> > <element name="externalid" ns="http://www.polopoly.com/ > polopoly/cm/app/xml"> > <text/> > </element> > </interleave> > <interleave> > <element name="major" ns="http://www.polopoly.com/polopoly/ > cm/app/xml"> > <choice> > <text/> > <data type="integer"/> > </choice> > </element> > <element name="minor" ns="http://www.polopoly.com/polopoly/ > cm/app/xml"> > <data type="nonNegativeInteger"/> > </element> > <optional> > <element name="version" ns="http://www.polopoly.com/ > polopoly/cm/app/xml"> > <data type="integer"/> > </element> > </optional> > </interleave> > </choice> > </define> OK, let me try... In short this is (ma? & e) | (ma & mi & v?) This can also be written deterministically as: (e ma?) | (ma (e | mi v? | v mi)) | (mi (ma v? | v ma)) | (v (ma mi | mi ma)) In XSD this becomes: <xs:complexType name="contentiddef"> <xs:choice> <xs:sequence> <xs:element ref="x:externalid"/> <xs:element ref="x:major" minOccurs="0"/> </xs:sequence> <xs:sequence> <xs:element ref="x:major"/> <xs:choice> <xs:element ref="x:externalid"/> <xs:sequence> <xs:element ref="x:minor"/> <xs:element ref="x:version" minOccurs="0"/> </xs:sequence> <xs:sequence> <xs:element ref="x:version"/> <xs:element ref="x:minor"/> </xs:sequence> </xs:choice> </xs:sequence> <xs:sequence> <xs:element ref="x:minor"/> <xs:choice> <xs:sequence> <xs:element ref="x:major"/> <xs:element ref="x:version" minOccurs="0"/> </xs:sequence> <xs:sequence> <xs:element ref="x:version"/> <xs:element ref="x:major"/> </xs:sequence> </xs:choice> </xs:sequence> <xs:sequence> <xs:element ref="x:version"/> <xs:choice> <xs:sequence> <xs:element ref="x:major"/> <xs:element ref="x:minor"/> </xs:sequence> <xs:sequence> <xs:element ref="x:minor"/> <xs:element ref="x:major"/> </xs:sequence> </xs:choice> </xs:sequence> </xs:choice> </xs:complexType> This is actually just building a FSM from the relax schema. I'm not sure if this can be done for every relax schema. But at least for those schemas that do have a FSM, it can be done automatically. So there might be a tool out there that does this. Does anyone know one? greetings, -- Sjoerd Visscher http://w3future.com/weblog/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|