[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Derivation problem

derivation problem

> -----Original Message-----
> From: PHDB _ [mailto:phdb2000@h...] 
> Sent: Friday, June 20, 2003 04:54
> To: xml-dev@l...
> Subject:  Derivation problem
> Hello everybody,
> I've got a problem with Xerces when validating an XML file. 
> Ths problem 
> comes from the XML Schema itself,
> although designed without any problem with XML Spy 5.
> The erroneous part is the following :
> -------------------------------------------------
> Generator.xsd file
> -------------------------------------------------
> <xs:complexType name="Field_Type">
> 	<xs:sequence>
> 		<xs:element name="GenericProcess" 
> type="Process_Type" minOccurs="0" 
> maxOccurs="unbounded"/>
> 	</xs:sequence>
> 	<xs:attribute name="FieldType" type="xs:string" use="optional"/>
> 	<xs:attribute name="DefaultValue" type="xs:string" 
> use="optional"/>
> 	<xs:attribute name="NbOfOccurence" type="xs:nonNegativeInteger" 
> use="optional"/>
> </xs:complexType>
> <xs:complexType name="Process_Type">
> 	<xs:attribute name="StepName" type="xs:string" use="required"/>
> 	<xs:attribute name="Function" type="xs:string" 
> use="required"/> </xs:complexType>
> 	<xs:complexType name="TextTableReference">
> 	<xs:complexContent>
> 		<xs:restriction base="Field_Type">
> 			<xs:sequence>
> 				<xs:element 
> name="GenericProcess" type="Process_Type" minOccurs="0"
> maxOccurs="unbounded"/>
> 			</xs:sequence>
> 			<xs:attribute name="DefaultValue" fixed="996"/>
> 		</xs:restriction>
> 	</xs:complexContent>
> </xs:complexType>
> --------------------------------------------------
> Xerces gives me :
> [Error] Generator.xsd:183:18: 
> derivation-ok-restriction.2.1.2: Error for 
> type 'TextTableReference'.  An
> attribute use in this type has a type which is not validly 
> derived from the 
> type of the matching attribute
> use in the base type.
> ---->I have this error because of the fixed="996", and even 
> because of 
> ---->the
> xs:attribute presence under
> restriction as far as I understand.

You have:

	<xs:attribute name="DefaultValue" fixed="996"/>

without "type=", so the type is xs:anySimpleType. This is not a
restriction of  xs:string.  You should add  type="xs:string"

As to the other errors you get, I don?t have a clue.

Alessandro Triglia

> [Error] Generator.xsd:180:44: cos-particle-restrict.2: 
> Forbidden particle 
> restriction:
> 'any:choice,sequence,all,elt'.
> [Error] Generator.xsd:180:44: 
> derivation-ok-restriction.5.3.2: Error for 
> type 'TextTableReference'.  The
> particle of the type is not a valid restriction of the 
> particle of the base.
> ----->These two extra errors may me due to the fact that 
> Field_Type has 
> ----->a
> child element (Generic Process),
> because if I change Field_Type and remove GenericProcess 
> child element, I 
> only have the first error adn not
> the three ones.
> I must admit that I don't find really clear the explanations 
> provided by the 
> w3c here

Object Oreiented speaking I want to derive TextTableReference from 
Field_Type and fixing teh attribute

Do you have any solution for my problem, apart from coding 
TextTableReference as a standalone type with its

attributes and child, because I have many types derived in the same way
TextTableReference from


Thanks in advance for your help.

Trouvez l'âme soeur sur MSN Rencontres ! http://g.msn.fr/FR1000/9551

The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl>


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.