Next in thread → Next in month →

Re: [xml-dev] Question about the sytax of namespace declarations

From
James Clark <>
To
Jason Diamond <>,
Date
2002-03-01T03:51:14Z
ID
<002b01c1c0d4$55d53380$>
Thread
Re: [xml-dev] Question about the sytax of namespace declarations
> > Wait-a-minute.
> >
> > Why would you want to undeclare a namespace prefix???
>
> I can only think of one reason why you'd want to undeclare a namespace
> prefix.
>
> <foo:bar xmlns:foo="#foo">
>     <baz xmlns:foo="" />
> </foo:bar>
>
> If this were legal, the baz element would _not_ have the foo namespace in
> its [in-scope namespaces] so you could <xsl:copy /> it to a result tree
> without causing the unused namespace declaration to appear on the element
> when you serialize that tree.

Right.

> Of course, this problem is really easy to get around.

Not completely.  It's a significant problem if you want to use a data-model
that includes the in-scope namespaces property.  With such a data-model it
is very hard to avoid the possibility of their being instances of the
data-model that is impossible to serialize correctly (where "correct" means
you would get the same thing back if you rebuilt the data-model by parsing
the serialized result).

> Personally, I don't
> think this particular use case justifies the feature but maybe Tim and
> Daniel have other things in mind.

I don't think it's an extra feature.  If you allow "xmlns" to undeclare the
default namespace, it's simpler and more straightforward (both for the spec
and implementations) to allow all namespace declarations to undeclare.  I
would instead say that disallowing undeclaration of non-default namespaces
is a restriction for which there is insufficient justification.

James
Next in thread → Next in month →