W3C home > Mailing lists > Public > www-xpath-comments@w3.org > January to March 2002

RE: [xsl] Namespace wildcards

From: Kay, Michael <Michael.Kay@softwareag.com>
Date: Tue, 5 Feb 2002 17:02:34 +0100
Message-ID: <DFF2AC9E3583D511A21F0008C7E6210602679C1A@daemsg02.software-ag.de>
To: "'Alex Kodat'" <ALEX@SIRIUS.sirius-software.com>, www-xpath-comments@w3.org
Cc: zarella@hmmci.com, davidc@nag.co.uk
> > But the question at the heart of this thread is "should 
> anyone new to
> > XSLT be doing this at all?" Needing to key off the local 
> name rather than
> > the expanded name is the sign of a badly designed set of 
> input languages
> > (using different namespaces when they ought not to be using the same
> > namespace) There no doubt are such uses but is this 
> something that you
> > need to make easy for a beginner?
> Not sure I understand this. What do you mean "to key off the 
> local name"?
> When you use the *:mumble syntax you're saying you don't 
> really care about
> the namespace, local name, whatever.

The semantics of "*:mumble" are "select an element whose local name is
'mumble', regardless what namespace it is in". The argument against allowing
this is that the local name 'mumble' is meaningless if you don't know what
namespace it's in, and we shouldn't be encouraging people to use meaningless
names. Does that make it clearer?

As I explained in my previous contribution, I think there are use cases
where *:mumble is legitimate, but I also agree with the point that it's
likely to encourage bad practice.

In fact, I think your suggestion that people will use *:mumble because of
the difficulty of defining namespace declarations in the XPath context
confirms these fears. It makes life too easy for people who can't be
bothered to declare their namespaces properly, and their queries will work
perfectly well until the day that someone creates a document that mixes in
names from another namespace.
> Anyway, I think it's important to keep in mind that XSLT 
> doesn't "own" XPath
> and that there are uses for XPath outside of XSLT ...

Sorry, but I can't see anything in this argument that's specific to XSLT:
it's equally true for any environment in which XPath is used. Is your
argument based on the fact that some XPath host environments make it
difficult to declare namespace prefixes in the XPath context? In that case,
I think those environments should be fixed.

Mike Kay 
Received on Tuesday, 5 February 2002 11:02:43 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:02:14 UTC