[
Lists Home |
Date Index |
Thread Index
]
- From: Jim Amsden <jamsden@us.ibm.com>
- To: <xml-dev@ic.ac.uk>
- Date: Wed, 9 Sep 1998 11:31:14 -0400
The problem is that the namespace spec does not define the semantics of a name.
<D:multistatus xmlns:D="DAV:">
specifies that prefix D corresponds to namespace DAV:, but it does not say what
this means. Applications are free to treat the prefix and the namespace name in
any way they desire. So the above is NOT equivalent to
<DA:multistatus xmlns:DA="AV:">
in any way. This isn't too surprising as DAV: and AV: are two different URIs
possibly representing two different namespaces But its not so obvious that this
one isn't equivalent either:
<DA:multistatus xmlns:DA="DAV:">
In this case, the local name for the elements are the same, as are their
namespaces. But the namespace spec says these are different elements having
different tag names. I think this is putting misplaced implied semantics on tag
name prefixes. The semantics should be on the local name and the namespace name
with the prefix being a notional convenience used to indicate the namespace
name. Then the prefix used in the DTD is independent of the ones used in any
document that is validated by it. This allows users to use whatever prefix they
need in order to avoid name collisions. If we're forced to use the same prefix
as defined in the DTD in order to validate documents, the namespace spec hasn't
changed anything. Names collisions will now happen because we can't use the
same prefix for more than one namespace.
Note that I'm not implying that tag names are the concatenation of the
namespace name and the local part of the tag name as specified by WebDAV
semantics, only that two elements with the same namespace name and local name
are treated as the same element type.
owner-xml-dev@ic.ac.uk on 09/09/98 09:27:29 AM
Please respond to mct@foyt.indyrad.iupui.edu
To: xml-dev@ic.ac.uk
cc:
Subject: Shocking News: Namespaces and Non-Validation
I was shocked to hear that namespaces invalidate validation.
The problem seems to be that DTD validation does not expand
prefixes, nor does it apply namespace defaulting.
Can you all set me straight?
(Apologies in advance to two knowledgable people who gave me advice on
this subject in private. They unfortunately disagreed with each
other, and now I am at a loss.
I hope you'll tell me that namespaces (esp. namespace defaulting) can
live peacefully with DTD validation.
)
The problem arises if a document uses <DATE>, with two different
content models. Suppose that in the "alpha" namespace, DATE contains
DAY and MONTH, while in the "beta" namespace, DATE has an attribute v.
Without namespaces, <DATE> would be ambiguous. It would need to
satisfy two different content models.
====================: Validation works with consistent PREFIXES
With prefixes, you could say (with appropriate definitions of the ALPHA
and BETA prefixes)
<TOP>
<SITE1>
<ALPHA:DATE> -- This
<DAY>10</DAY>
<MONTH>Sept</MONTH>
</ALPHA:DATE>
</SITE1>
<ELT2>
<BETA:DATE v="tuesday"/>
</ELT2>
</TOP>
The above would be valid, if only because a DTD processor could just
ignore the namespace, and treat the element name's as ALPHA:DATE and
BETA:DATE.
================: Validation fails with locally chosen prefixes
Now, suppose the DTD defines
xmlns:KAPPA="uri:alpha"
<!ELEMENT KAPPA:DATE (KAPPA:DAY KAPPA:MONTH) >
...
and the document that uses the "uri:alpha" dtd uses the prefix ALPHA
In this case the document would mention
<ALPHA:DATE>
MY QUESTION: Would a DTD processor figure out that KAPPA:DATE
and ALPHA:DATE are the same element, (since the expansions of KAPPA
and ALPHA are the same?
================: Validation dies when namespace defaults are used
And finally, DTD's seem to die completely if a document uses
namespace defaulting. The DTD validator will not even attempt
to think that the first <DATE> refers to "uri:alpha"+DATE.
But with namespace defaulting
<TOP>
<SITE1 xmlns="uri:alpha">
<DATE> -- This is just DATE
<DAY>10</DAY>
<MONTH>Sept</MONTH>
</DATE>
</SITE1>
<ELT2 xmlns="uri:beta">
<DATE v="tuesday"/> -- This is also just DATE
</ELT2>
</TOP>
a DTD processor would not figure out that
<DATE v="tuesday"/> should be from the "beta" DTD,
and
<DATE> -- This
<DAY>10</DAY>
<MONTH>Sept</MONTH>
</DATE>
should be checked against the "alpha" DTD.
MY QUESTION: Is there any hope that namespaces and DTD's
can get along?
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)
|