Re: Using xml:lang in Schemas

I am somewhat confused by this.  I was of the impression that the
character sequence "xml" was reserved and therefore it would not be
legal for someone to define it as a prefix, since prefixes are simply
shorthand for a namespace, but "xml:foo" would imply some kind of
special processing on "foo" as opposed to "foo from the namespace bound
to the 'xml' prefix".  In this vain, I had assumed that xml:lang (since
one does see this quite often) was a special instruction, whereas now I
am getting the impression that it is simply convention.  i.e. "abc:lang"
would work equally well if "abc" was bound to the XML namespace.

Are there special rules which _only_ allow the "xml" prefix to be bound
to the "XML Namespace" namespace?

Conversely, are there special rules which state that the XML namespace
_can_only_ be bound to the "xml" prefix?

By way of example:

<foo
xmlns="http://www.example.com/default_namespace"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:aaa="http://www.w3.org/XML/1998/namespace"
xmlns:bbb="http://www.example.com/another_namespace" >
  <bar xml:lang="en" />
  <baz aaa:lang="en" />
  <bang bbb:lang="1234" />
</foo>

Presumably the <bar> and <bang> elements are acceptable.  How does the
schema for "http://www.example.com/default_namespace" come into this?

Does it need to explicitly allow xml:lang and bbb:lang attributes on the
<bar> and <bang> elements respectively?

Is the declaration of "http://www.w3.org/XML/1998/namespace" unnecessary
because it would have been declared in the schema for the default
namespace?

Is there any way to add "xml:lang" attributes to an element even if they
are not explicitly permitted by the schema?

I recall reading somewhere that explicitly namespaced attributes could
exist on elements even if they were not declared as part of the parent
elements schema definition of the content model.  Is this inaccurate (or
am I imagining this)?

Looking at the schema http://www.w3.org/2001/xml.xsd continues to
confuse me as there are references to xml:lang without the xml prefix
being declared anywhere.  Obviously there are things here in the way
namespaces, schemas, xml:lang, the "xml" character sequence, and
namespace prefix binding work that I don't understand and I would
certainly appreciate some clarification.

On Thu, Jun 20, 2002 at 08:30:34AM +0100, Henry S. Thompson wrote:
> 
> Just to amplify one aspect of Jeni's remarks -- the schemadoc for
> schemas imports xml and refs xml:lang to allow xml:lang to appear on
> e.g. xs:documentation elements.  So in _your_ schema docs, you can
> write
> 
>   . . .
>   <xs:documentation xml:lang="IT">porta del'inferno</xs:documentation>
>   . . .
> 
> But that doesn't mean the xml _schema_ is available inside _your_
> schema docs -- if you want to allow xml:lang in your instance
> documents, you need to ref the declaration of xml:lang in your schema, 
> which in turn means you need to import the xml schema doc (from
> http://www.w3.org/2001/xml.xsd).
> 
> ht
> 
> [Spot the obscure World Cup reference in the above message and win a
> non-cash non-prize :-]
> -- 
>   Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
>           W3C Fellow 1999--2002, part-time member of W3C Team
>      2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
> 	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
> 		     URL: http://www.ltg.ed.ac.uk/~ht/
>  [mail really from me _always_ has this .sig -- mail without it is forged spam]
> 

-- 
Ian Stokes-Rees, Client Services      DecisionSoft Limited
+44-1865-203192                       http://www.decisionsoft.com

Received on Tuesday, 23 July 2002 05:47:47 UTC