OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Derivation problem

[ Lists Home | Date Index | Thread Index ]



> -----Original Message-----
> From: PHDB _ [mailto:phdb2000@hotmail.com] 
> Sent: Friday, June 20, 2003 04:54
> To: xml-dev@lists.xml.org
> Subject: [xml-dev] 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
> 
http://www.w3.org/TR/xmlschema-1/

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

DefauktValue.
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
as 
TextTableReference from

Field_Type.

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>






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS