RE: Xerces problem

According to XML Schema definition this is not valid.
You are using a localComplexType and not a topLevelComplexType definition.

And here the use of attribute is "prohibited", see excerpt of XML Schema
below:

 <xs:complexType name="localComplexType">
  <xs:complexContent>
   <xs:restriction base="xs:complexType">
    <xs:sequence>
     <xs:element ref="xs:annotation" minOccurs="0"/>
     <xs:group ref="xs:complexTypeModel"/>
    </xs:sequence>
    <xs:attribute name="name" use="prohibited"/>
    <xs:attribute name="abstract" use="prohibited"/>
    <xs:attribute name="final" use="prohibited"/>
    <xs:attribute name="block" use="prohibited"/>
   </xs:restriction>
  </xs:complexContent>
 </xs:complexType>

You are trying to give a local complexType definition a name, which makes no
sense.
Names of global types, elements and attributes are in conjunction with the
targetNamespace of a schema identifiers, so that these definitions can be
used and referenced from other places within either the current or another
importing schema file.

Local types, elements and attributes cannot be referenced and therefore the
name attribute would be useless.

Best regards,
Peter


Peter Kriegesmann
Phone	 06151-921484
Electronic Business Technologies (QE)				Fax
06151-921612
			
Software AG
http://www.softwareag.com
Uhlandstrasse 12				  
D-64297 Darmstadt
mailto:Peter.Kriegesmann@softwareag.com	


-----Original Message-----
From: Horti, Andras [mailto:andras.horti@joanneum.at]
Sent: Freitag, 10. Januar 2003 10:59
To: 'xmlschema-dev@w3.org'
Subject: AW: Xerces problem



I changed the line:
  <xs:complexType>
to
  <xs:complexType name="Personnel Type">

According to XMLSchema definition should be valid.


> -----Ursprüngliche Nachricht-----
> Von: Lemmin, Harald [mailto:Harald.Lemmin@softwareag.com]
> Gesendet: Freitag, 10. Jänner 2003 10:36
> An: 'xmlschema-dev@w3.org'
> Betreff: RE: Xerces problem
> 
> 
> 
> Where did you extend the name attribute?
> 
> The schema should look like this:
>   <xs:element name = "personnel">
>     <xs:complexType>
>       <xs:complexContent>
>         <xs:extension base = "person">
>           <xs:attribute name = "name" type = 
> "xs:string"></xs:attribute>
>         </xs:extension>
>       </xs:complexContent>
>     </xs:complexType>
>   </xs:element>
> 
> 
> 
> -----Original Message-----
> From: Horti, Andras [mailto:andras.horti@joanneum.at]
> Sent: Freitag, 10. Januar 2003 09:04
> To: xmlschema-dev@w3.org
> Subject: Xerces problem
> 
> 
> 
> Hi All,
> 
> I extended the "personal.xsd" so that the comlexType 
> definition has a name
> attribute. Xerces complains about, my understanding is that 
> it is allowed.
> Who is right ?
> 
> Xsd:
> 
>  <xs:element name="personnel">
>   <xs:complexType name="Personnel Type">
>    <xs:sequence>
>      <xs:element ref="person" minOccurs='1' maxOccurs='unbounded'/>
>    </xs:sequence>
>   </xs:complexType>
> 
> 
> Output:
> D:\xerces-2_2_1\samples>java -classpath
> .;\xerces-2_2_1\xercesImpl.jar;\xerces-2
> _2_1\xmlParserAPIs.jar sax.Counter -s -v ..\data\personal-schema.xml
> [Error] personal.xsd:5:41: s4s-att-not-allowed: Attribute 
> 'name' cannot
> appear in element 'complexType'.
> 
> Best Regards
> Andras Horti
> 

Received on Friday, 10 January 2003 07:03:00 UTC