OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Namespace: what's the correct usage?

> Without the xmlns='' a validator wouldn't know where to look for the
> declaration of name (which according to XML Namespaces would be http://foo
> and according to XML Schemas would be urn:x2). If the unr:x2 schema defined

This statement is wrong, and I saw other people made the same
misunderstanding. That's why I hate the entire ridiculous concept of
the "unqualifed local element".

The rule is "XML Schema doesn't change the interpretation of namespaces".

There is no exception to this rule. No matter what option do you use,
this rule applies.

Let me introduce two examples and prevent this confusion from happening

<?xml version="1.0"?>
<foo xmlns="ns1">
  <p:bar xmlns:p="ns2">

is interpreted as:

    <{ns1}child />       <-- not ns2!

It doesn't matter whether you use XML Schema or not.


<?xml version="1.0"?>
  <p:bar xmlns:p="ns1">

is interpreted as:


even if you use XML Schema.

P.S. If you are not familiar with {uri}local notation, you may want to
read http://www.jclark.com/xml/xmlns.htm

E-Mail: kohsukekawaguchi@yahoo.com