- From: Eddie Robertsson <eddie@allette.com.au>
- Date: Tue, 11 Sep 2001 09:50:29 +1000
- To: NJayaraman@tomax.com
- CC: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Hi, > Hi All, > I am recieving the above error message when I try to parse the > following xml. Please let me know how to solve this problem. In XML-spy it > works fine. xerces-J 1.4.2 fails. > Thanks !! > > <xsd:complexType name="AddressLineType"> > <xsd:simpleContent> > <xsd:restriction base="xsd:string"> > <xsd:attribute name="index" type="xsd:string" use="optional" > default="1"/> > </xsd:restriction> > </xsd:simpleContent> > </xsd:complexType> The problem is that when you're restricting a complexType in XML Schema the base to must also be a complexType. What you want to do in the above example is to extend the simpleType xs:string by adding an attribute. Since simpleTypes can't carry attributes you have to use a complexType with simple content but instead of restricting the simpleType xs:string you should extend it. So, change xs:restriction to xs:extension and everything should work fine. Cheers, /Eddie
Received on Monday, 10 September 2001 19:50:24 UTC