- From: Michael Burns <Michael.Burns@sas.com>
- Date: Tue, 5 Dec 2000 16:08:53 -0500
- To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>, "'xmlsupport@tibco.com'" <xmlsupport@tibco.com>, "'beta@xmlspy.com'" <beta@xmlspy.com>
- Message-ID: <764CA2FF49EC054BA086FC8253A52DD7624DF4@merc09.us.sas.com>
I am still struggling with a schema I generated from a UML model. I am trying to imlement UML-type one to many association with elements that can be subclassed. Frustrated at the progress I made with even a fairly simple model, I have reduced it to an extremely simple model: one class (Vertebrate) that can prey on a list of other Vertebrates via an association called PreyList. But, in an instance document the PreyList element is not recognized as a valid subelement of Vertebrate. I have posted this before and gotten some help with it but have not made significant progress. Thinking I was using the spec elements in ways they were not intended, I have rewritten the schema from scratch using XML Authority to see how it chooses to code the schema. XMLAuthority v2 validates this schema as OK, so does XMLSpy v3.5. Here is the schema (Vertebrate.xsd): <?xml version = "1.0" encoding = "UTF-8"?> <!--Generated by XML Authority. Conforms to w3c <http://www.w3.org/2000/10/XMLSchema--> http://www.w3.org/2000/10/XMLSchema--> <xsd:schema xmlns:critters = " <http://www.sas.com/Critters> http://www.sas.com/Critters" targetNamespace = " <http://www.sas.com/Critters> http://www.sas.com/Critters" xmlns:xsd = " <http://www.w3.org/2000/10/XMLSchema> http://www.w3.org/2000/10/XMLSchema" version = "" elementFormDefault = "unqualified" attributeFormDefault = "unqualified"> <!-- edited with XML Spy v3.5 NT beta 2 build Dec 1 2000 ( <http://www.xmlspy.com/> http://www.xmlspy.com) by Michael Burns (SAS Institute, Inc.) --> <xsd:complexType name = "VertebrateType"> <xsd:sequence> <xsd:element name = "PreyList" minOccurs = "0"> <xsd:complexType> <xsd:sequence> <xsd:element ref = "critters:Vertebrate" minOccurs = "0" maxOccurs = "unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> <xsd:attribute name = "Name" use = "required" type = "xsd:Name"/> <xsd:attribute name = "Bones" type = "xsd:boolean"/> <xsd:attribute name = "NLimbs" type = "xsd:nonNegativeInteger"/> <xsd:attribute name = "LimbType" use = "required"> <xsd:simpleType> <xsd:restriction base = "xsd:string"> <xsd:enumeration value = "leg"/> <xsd:enumeration value = "wing"/> <xsd:enumeration value = "fin"/> <xsd:enumeration value = "none"/> <xsd:enumeration value = "mixed"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> <xsd:element name = "Vertebrate" > <xsd:complexType> <xsd:complexContent> <xsd:extension base = "critters:VertebrateType"> <xsd:sequence/> </xsd:extension> </xsd:complexContent> </xsd:complexType> </xsd:element> </xsd:schema> Here is the very simple instance (VertPreysOnVert.xml): <?xml version="1.0" encoding="UTF-8"?> <!-- edited with XML Spy v3.5 NT beta 2 build Dec 1 2000 ( <http://www.xmlspy.com/> http://www.xmlspy.com) by Michael Burns (SAS Institute, Inc.) --> <Vertebrate xmlns="http://www.sas.com/Critters" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:schemaLocation="http://www.sas.com/Critters Vertebrate.xsd" Name="MarshHawk" LimbType="wing"> <PreyList> <Vertebrate Name="Mickey"/> </PreyList> </Vertebrate> Like I said, XMLSpy and XMLAuthority both validate the schema fine. However, XMLSpy, XSV and Oracle's schema validating parser all agree that <PreyList> does not belong as a contained element inside <Vertebrate>. XSV says: - - - - - - - - - - - - Problems with the schema-validity of the target file:/C:/ModelCompilerTestPen/test/critters/XMLauthority/VertPreysOnVert.xml:4:2: Invalid per cvc-complex-type.1.2.4 <http://www.w3.org/TR/xmlschema-1/#cvc-complex-type> : element {http://www.sas.com/Critters}:PreyList not allowed here in element {http://www.sas.com/Critters}:Vertebrate: file:/C:/ModelCompilerTestPen/test/critters/XMLauthority/VertPreysOnVert.xml:4:2: Invalid per src-resolve <http://www.w3.org/TR/xmlschema-1/#src-resolve> : undeclared element {http://www.sas.com/Critters}:PreyList - - - - - - - - - - - - Oracle validator says: - - - - - - - - - - - - Parsing VertPreysOnVert.xml <Line 8, Column 12>: XSD-2034: (Error) Element 'PreyList' not expected. <Line 11, Column 14>: XSD-2021: (Error) Element not completed: 'Vertebrate' Parser Exception: Element 'PreyList' not expected. - - - - - - - - - - - - XMLSpy says roughly the same thing. XMLAuthority does not validate instances, and XMLInstance is not up to snuff yet. -------------------------------------------------------------------------------------------- Michael Burns email: Michael.Burns@sas.com Principal Systems Developer home: mburns@bga.com Metadata Integration Technology voice: (512)258-5171x3264 SAS Institute, Inc. fax: (512)258-3906 11920 Wilson Parke Ave. www: http://www.realtime.net/~mburns Austin, TX 78726-4052 sww: http://sww.sas.com/~sasmkb "choose for yourselves today whom you will serve;... but as for me and my house, we will serve the Lord." Joshua 24:15
Received on Tuesday, 5 December 2000 16:09:29 UTC