- From: Felix Sasaki <fsasaki@w3.org>
- Date: Fri, 25 Nov 2005 01:22:51 +0900
- To: "Jeremy Carroll" <jjc@hpl.hp.com>, "Addison Phillips" <addison.phillips@quest.com>
- Cc: www-international@w3.org
Hello Jeremy,
I hope that it is o.k. with Addison if I reply here, since I think this
section was based on a comment from me.
As for XML Schema, reusing definitions from other namespaces than the
target namespace of a schema needs to be done even for the XML 1.0
namespace, in order to declare attributes such as xml:lang.
The following example shows how to do that and is based on
http://www.xml.com/pub/a/2000/11/29/schemas/part1.html?page=8
<xs:schema targetNamespace="http://example.org/ns/books/"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:bk="http://example.org/ns/books/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="qualified">
<!-- the follwoing imports the schema for the xml namespace -->
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
<!-- this element uses declarations from the xml namespace -->
<xs:element name="title">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="xml:lang"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
An additional comment below.
On Thu, 24 Nov 2005 23:54:57 +0900, Jeremy Carroll <jjc@hpl.hp.com> wrote:
>
>
> Addison
>
> I was somewhat surprised at:
> [[
> XML Schema requires that the xml namespace be declared and imported
> before using xml:lang (and other xml namespace values)
> ]]
> http://www.w3.org/International/questions/qa-when-xmllang
>
> since in:
> http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-using
> I read:
> [[
> The namespace prefix, unless it is xml or xmlns, must have been declared
> in a namespace declaration attribute in either the start-tag of the
> element where the prefix is used or in an an ancestor element (i.e. an
> element in whose content the prefixed markup occurs). The prefix xml is
> by definition bound to the namespace name
> http://www.w3.org/XML/1998/namespace.
> ]]
http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-using is about xml
documents, not schemas. Unfortunately, "declared" has these two senses in
xml terminology: declaration of the namespace in an instance via "xmlns",
and declaration of an attribute *from* a namespace in a schema.
I hope that helps. Best, Felix.
>
> Please clarify
>
> Jeremy
>
> Richard Ishida wrote:
>> After incorporating comments from the review phase, the GEO Working
>> Group has published the article:
>> xml:lang in XML document schemas
>> http://www.w3.org/International/questions/qa-when-xmllang
>> By Addison Phillips, Quest Software
>> The article provides an answer to the question: When should I use
>> xml:lang and when should I define my own element or attribute for
>> passing language values in an XML document schema (DTD)?
>> You can find various news filters and RSS feeds relating to the
>> work of the Internationalization Activity at
>> http://www.w3.org/International/log/description
>> ============
>> Richard Ishida
>> Internationalization Lead
>> W3C
>> http://www.w3.org/People/Ishida/
>> http://www.w3.org/International/
>> http://people.w3.org/rishida/blog/
>> http://www.flickr.com/photos/ishida/
>>
>
>
>
Received on Thursday, 24 November 2005 16:24:47 UTC