Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Extending a schema using xsd:redefine

From: "Dirc Khan-Evans" <dirc.khan-evans@----.--->
To: NULL
Date: 9/1/2004 11:56:00 AM
Are there any XSD experts out there who could help me?

We have an existing schema which I need to be able to extend. I need to add
extra choices to one of the elements.
I have created a new schema and am trying to redefine one of the elements to
add another element to the  choices.
However, I keep getting the following errors when trying to validate the
schema:

1) The base attribute of a restriction/extension must be the same as the
complexType's name attribute in <redefine>
2) Global complexType:'link' declared more than once or also declared as
simpleType

The link element is a complex type in the original schema.

The extended schema is below:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" targetNamespace="http://www.blah.com/data/">

 <xs:redefine schemaLocation="MainSchema.xsd">
  <xs:complexType name="link">
   <xs:choice>
    <xs:extension base="link">
     <xs:choice minOccurs="0" maxOccurs="1">
      <xs:element ref="expenses"/>
     </xs:choice>
    </xs:extension>
   </xs:choice>
  </xs:complexType>
 </xs:redefine>

 <xs:element name="expenses">
  <xs:complexType>
   <xs:sequence maxOccurs="unbounded">
    <xs:element maxOccurs="unbounded" name="expense"/>
   </xs:sequence>
  </xs:complexType>
 </xs:element>

 <xs:element name="expense">
  <xs:complexType>
   <xs:attribute name="amount" use="required" type="xs:decimal"/>
   <xs:attribute name="rate" use="required" type="xs:decimal"/>
   <xs:attribute name="type" use="required" type="xs:NCName"/>
  </xs:complexType>
 </xs:element>
</xs:schema>






transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent