[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to find and remove unproductive elements from XML Schemas
Hi Folks, At the bottom of this message is an XML Schema. It looks innocent: all its elements are declared and it does not exhibit any suspicious constructions. And it validates just fine. But it contains unproductive elements: The B-element loops infinitely. Unproductive elements are dead wood and should be removed. I wrote a mini-tutorial that describes how to systematically find and remove unproductive rules: http://xfront.com/formal-languages/How-to-find-and-remove-unproductive-rules-from-a-grammar.pptx /Roger <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Document"> <xs:complexType> <xs:choice> <xs:element name="S1"> <xs:complexType> <xs:sequence> <xs:element name="A"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="a" /> </xs:restriction> </xs:simpleType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="S2"> <xs:complexType> <xs:sequence> <xs:element name="B" type="B-type" /> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> <xs:complexType name="B-type"> <xs:sequence> <xs:element name="B" type="B-type" /> </xs:sequence> </xs:complexType> </xs:schema>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
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
|