- From: David Valera <dvalera@pcl-hage.nl>
- Date: Fri, 27 Oct 2000 10:18:57 +0200
- To: <Mike_Leditschke@nemmco.com.au>, <xmlschema-dev@w3.org>
> I am attempting to build a number of XML schemas using the > http://www.w3.org/1999/XMLSchema version of the spec. I am using > XMLSpy which is reporting errors on XML that looks valid to me. > > I would appreciate an indication as to whether or not the errors are > legitimate. > > > Problems > > 1. The XML below gets the message below when validation is attempted. > > "We are sorry, but the elements that have the same name but > different types > functionality is not yet implemented in this version". > > <?xml version="1.0" encoding="UTF-8"?> > <!-- edited with XML Spy v3.0.7 NT (http://www.xmlspy.com) by Michael > Leditschke (NEMMCO) --> > <schema xmlns="http://www.w3.org/1999/XMLSchema"> > <complexType name="a"> > <element name="c" type="string"/> > </complexType> > <complexType name="b"> > <element name="c" type="decimal"/> > </complexType> > </schema> > > The two c elements are part of different type definitions and > should be > locally scoped and hence happily have different types. Yes/No? see Henry's answer. This is not yet implemented in this version. Hopefully it will be in the upcoming 3.5 version of XMLSpy. > 4. The XML below gets the message below when validation is attempted > > "DTD/Schema error - element 'd' already defined" (the second > definition is > highlighted). > > <?xml version="1.0" encoding="UTF-8"?> > <!-- edited with XML Spy v3.0.7 NT (http://www.xmlspy.com) by Michael > Leditschke (NEMMCO) --> > <schema xmlns="http://www.w3.org/1999/XMLSchema"> > <complexType name="a"> > <element name="d"> > <simpleType base="string"> > <length value="5"/> > </simpleType> > </element> > </complexType> > <complexType name="b"> > <element name="d"> > <simpleType base="string"> > <length value="5"/> > </simpleType> > </element> > </complexType> > </schema> I have avoided this issue declaring the elementypes globally (I have added the xsd namespace, otherwise you will get errors validating this file): <?xml version="1.0" encoding="UTF-8"?> <!-- edited with XML Spy v3.0.7 NT (http://www.xmlspy.com) by Michael Leditschke (NEMMCO) --> <xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema"> <xsd:complexType name="a"> <xsd:element name="d" type="mytype" /> </xsd:complexType> <xsd:complexType name="b"> <xsd:element name="d" type="mytype" /> </xsd:complexType> <xsd:simpleType name="mytype" base="xsd:string"> <xsd:length value="5"/> </xsd:simpleType> </xsd:schema> I hope this helps you out... David Valera
Received on Friday, 27 October 2000 04:18:57 UTC