Lists Home |
Date Index |
- From: Peter Jones <firstname.lastname@example.org>
- To: 'Mark Tucker' <email@example.com>, "'firstname.lastname@example.org'" <email@example.com>
- Date: Wed, 9 Sep 1998 14:50:52 +0100
Here's how I see it (but I'm no expert).
Namespaces and DTDs do get along, but only if the declarations of
element types in the DTD contain qualified names (prefix:elementname)
that match the names of namespaced elements in the doc entity.
e.g. (and I'm not sure of the syntax here...)
<!ELEMENT qual:name (content | model | #PCDATA) >
<qual:name> blah blah </qual:name>
But if you use two versions of qual:name in the doc then, even if you
define the namespace prefix to refer to a different URI in each case,
the process of validation will force both versions of qual:name to
conform to the same content model.
So basically, avoid duplicate prefixes for validation.
[For consideration of XML-DEV
I don't see why the URI for the namespace prefix could not refer to the
address of the DTD for the element concerned, for validation.]
> -----Original Message-----
> From: Mark Tucker [SMTP:firstname.lastname@example.org]
> Sent: Wednesday, September 09, 1998 2:13 PM
> To: email@example.com
> 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
> and BETA prefixes)
> <ALPHA:DATE> -- This
> <BETA:DATE v="tuesday"/>
> 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
> ================: Validation fails with locally chosen prefixes
> Now, suppose the DTD defines
> <!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
> 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
> <SITE1 xmlns="uri:alpha">
> <DATE> -- This is just DATE
> <ELT2 xmlns="uri:beta">
> <DATE v="tuesday"/> -- This is also just DATE
> a DTD processor would not figure out that
> <DATE v="tuesday"/> should be from the "beta" DTD,
> <DATE> -- This
> 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,
> Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
> To (un)subscribe, mailto:firstname.lastname@example.org the following message;
> (un)subscribe xml-dev
> To subscribe to the digests, mailto:email@example.com the following
> subscribe xml-dev-digest
> List coordinator, Henry Rzepa (mailto:firstname.lastname@example.org)
xml-dev: A list for W3C XML Developers. To post, mailto:email@example.com
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:firstname.lastname@example.org the following message;
To subscribe to the digests, mailto:email@example.com the following message;
List coordinator, Henry Rzepa (mailto:firstname.lastname@example.org)