[XML-SIG] namespace/localpart tuples (was: Future plans)

Thomas B. Passin tpassin@idsonline.com
Thu, 6 Jan 2000 22:36:40 -0500

uche.ogbuji@fourthought.com> wrote:

> > > > I've also been thinking that we may want
> > > > qualified names to be represented as tuples, either
> > > >
> > > >   (namespace name (URI), localpart (element type name), prefix)
> > > >
> > > > or
> > > >
> > > >   (namespace name (URI), localpart (element type name))
> > >
> > > I think it might be more natural to always make it a triple, and
simply have
> > > '' as the third item when there is no namespace.
> >
> > At processing time, the prefix that was used is irrelevant. It shouldn't
> > be preserved.
> The prefix has no semantic value: it is indeed syntactic sugar.  However,
> is very important to maintain the "principle of least surprise" for users.
> If a user runs his XSLT stylesheet through a SAX processor and finds that
> his "xsl:template" elements have been renamed to "prefix00001:template",
> might be very confused indeed.
> Note that there is at least one case in which the prefix does matter: XSLT
> uses the prefix to match declared namespaces in the stylesheet to
> in the source document.  Now many people have already railed against this
> violation of the spirit of XML Namespaces 1.0, but there is no srguing
that it
> was the most elegant solution to a difficult problem that the XSLT WG
faced in
> dealing with namespaces.
> So, in short, though prefixes are not technically part of the document,
> are good arguments for including them in the SAX binding.
> > You could end up in a situation where a client thinks that prefix
> > be used when regenerating XML output... the problem is that it may
> > conflict (say, if you combined a couple XML docs) or not be defined in
> > (new) output (if you dropped some portion that defined the namespace).
> The best solution to this is education.  If the interface documentation
> clearly states that prefixes are not technically part of the document,
> hopefully users will avoid mis-using them.  This is not ideal, but there's
> much better to do given the practical issues involved.
> > IMO, it is much better to regenerate a new set of prefixes for the set
> > namespace URIs that are present in an XML document.
> Even as a user who knows better about the meaning of prefixes, I would be
> annoyed at a processor that did this.  I often deal with documented with 4
> more namespaces (this is not too unusual: very common in RDF) and I give
> prefixes mnemonic names to help sort things out.  I don't want processors
> renaming them to "p01a3", etc.
I'm completely with Uche on this - sugar or not, we should preserve the
prefixes.  After all, your software can always ignore them later if you
don't care.  And, again as Uche says, the prefixes sometimes are chosen to
help document the meaning of the document.

Tom Passin