W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2002

Using xml:lang in Schemas

From: Danny Vint <dvint@mindspring.com>
Date: Tue, 18 Jun 2002 11:30:06 -0700
Message-Id: <>
To: xmlschema-dev@w3.org

I'm trying to determine how xml:lang is to be used with Schemas. In the Pt1 
document we have the following XSD element definitions that include a 
reference to xml:lang:

3.13.2 XML Representation of Annotation Schema Components
Annotation of schemas and schema components, with material for human or 
computer consumption, is provided
for by allowing application information and human information at the 
beginning of most major schema elements,
and anywhere at the top level of schemas. The XML representation for an 
annotation schema component is an
<annotation> element information item. The correspondences between the 
properties of that information item
and properties of the component it corresponds to are as follows:
XML Representation Summary: annotation Element Information Item
id = ID
{any attributes with non-schema namespace . . .}>
Content: (appinfo | documentation)*
source = anyURI>
Content: ({any})*
source = anyURI
xml:lang = language>
Content: ({any})*
3.15.2 XML Representations of Schemas
A schema is represented in XML by one or more ·schema documents·, that is, 
one or more <schema>
element information items. A ·schema document· contains representations for 
a collection of schema
components, e.g. type definitions and element declarations, which have a 
common {target namespace}. A
·schema document· which has one or more <import> element information items 
corresponds to a schema with
components with more than one {target namespace}, see Import Constraints 
and Semantics (§4.2.3).
XML Representation Summary: schema Element Information Item
attributeFormDefault = (qualified | unqualified) : unqualified
blockDefault = (#all | List of (extension | restriction |
substitution)) : ''
elementFormDefault = (qualified | unqualified) : unqualified
finalDefault = (#all | List of (extension | restriction)) : ''
id = ID
targetNamespace = anyURI
version = token
xml:lang = language
{any attributes with non-schema namespace . . .}>
Content: ((include | import | redefine | annotation)*, (((simpleType |
complexType | group | attributeGroup) | element | attribute | notation),

This seems to me to make xml:lang (how about the xml:preserve-space?) 
special XML attribute to be there and available by default and that any 
namespace requirements are automagically handled by the parser.

Currently I have tried to use this with XML Spy which seems to force a 
required definition to be available to use this in an <xsd:element> 
definition. I tried defining the names space on the <xsd:schema> element 
and then using an <xsd:attroibute ref="xml:lang" in the element 
description. I noted that an I can't use this <xml:attribute 
name="xml:lang" because of some rule about using prefixes in attribute name 
definitions and besides this is something that is supposed to "Just be 
there" from an XML standpoint.

The SPy folks indicate that this is the proper way to access at least the 
xml:lang attribute:

<xs:import namespace="http://www.w3.org/XML/1998/namespace"
Get access to the xml: attribute groups for
And then you can use xml:lang as an attribute:
<xs:attribute ref="xml:lang"/>

Now this seems odd, if it is complete, that I have the proper namespace URL 
being referenced, but I have nothing that maps the xml prefix to this 
namespace - sort of makes me feel like there is some half built in 
understanding that xml: is reserved and that it points to that namespace - 
but don't use it unless you define it!

Anyway, what is the opinion or real way that this should be defined? I 
don't find the Schema spec to be much use in determining the actual way to 
use these attributes.

Received on Tuesday, 18 June 2002 14:32:30 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:57 UTC