RE: W3C xml.xsd schema

Hello,

Normally, you would need a namespace declaration just as you say.
However, the XML 1.0 recommendation specifies that the "xml" prefix is
automatically mapped to the namespace
http://www.w3.org/XML/1998/namespace, so you don't have to declare it.
If it were any other prefix/namespace, you would need the declaration in
order for the attribute references to work.

Hope that helps,

Priscilla

-----------------------------------------------------
Priscilla Walmsley             priscilla@walmsley.com
Author, Definitive XML Schema     (Prentice Hall PTR)
----------------------------------------------------- 

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of 
> zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN
> Sent: Friday, April 26, 2002 10:01 AM
> To: xmlschema-dev@w3.org
> Subject: W3C xml.xsd schema
> 
> 
> Hi,
> 
> I'm a newbie at XML Schema and I don't understand all the 
> stuff about namespaces.
> 
> In the schema joined to this mail (a simplified version of 
> http://www.w3.org/2001/xml.xsd),
> are the attributes contained 
> by specialAttrs referencing the one that are defined
> in the same schema ?
> 
> If it is the case, why isn't there an 
> xmlns:xml="http://www.w3.org/XML/1998/namespace" 
> attribute for the schema ?
> 
> <?xml version='1.0'?>
> <xs:schema 
> targetNamespace="http://www.w3.org/XML/1998/namespace" 
> xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">
> 
>  <xs:attribute name="lang" type="xs:language"/>
> 
>  <xs:attribute name="space" default="preserve">
>   <xs:simpleType>
>    <xs:restriction base="xs:NCName">
>     <xs:enumeration value="default"/>
>     <xs:enumeration value="preserve"/>
>    </xs:restriction>
>   </xs:simpleType>
>  </xs:attribute>
> 
>  <xs:attribute name="base" type="xs:anyURI"/>
> 
>  <xs:attributeGroup name="specialAttrs">
>   <xs:attribute ref="xml:base"/>
>   <xs:attribute ref="xml:lang"/>
>   <xs:attribute ref="xml:space"/>
>  </xs:attributeGroup>
> 
> </xs:schema>
> 
> Thanks.
> 
> --
> Michaël Marchegay, Stagiaire France Telecom R&D du 11/02/2002 
> au 26/07/2002
> Sous la responsabilité d'Olivier Dubuisson
> DTL/TAL - 22307 Lannion Cedex - France
> 
> 

Received on Friday, 26 April 2002 17:00:36 UTC