Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Extending a schema using xsd:redefine [Thread Next] Re: Extending a schema using xsd:redefineTo: NULL Date: 9/1/2004 9:35:00 PM Make sure that the targetNamespace of the base schema is the same as the one
which is redefining it.
The contents of the redefine below seems be incorrect according to the
semantics of XSD, it should be:
<xs:redefine schemaLocation="MainSchema.xsd">
<xs:complexType name="link">
<xs:complexContent>
<xs:extension base="link">
<xs:choice minOccurs="0" maxOccurs="1">
<xs:element ref="expenses"/>
</xs:choice>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:redefine>
"Dirc Khan-Evans" <dirc.khan-evans@e...> wrote in message
news:OXl18IBkEHA.592@T......
> 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>
>
>
>
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
