Re: [xsl] Proposed syntax for namespace binding in XPath

Subject: Re: [xsl] Proposed syntax for namespace binding in XPath
From: Florent Georges <darkman_spam@xxxxxxxx>
Date: Sun, 1 Apr 2007 05:14:19 +0200 (CEST)
Michael Kay wrote:


  I'm not an expert in those matters, but following are a few comments
that can be useful, maybe.

> xmlns(abc=

> There are several disadvantages to adopting this directly.
> It doesn't allow the default namespace to be bound;

  A simple extension would permit that, for example:


> it's not easily distinguishable from a function call; it
> can't handle a URI containing an unpaired right bracket;

  Mmh, with URI escaping, I think there would be no problem.

> and it doesn't fall back to pure XPath when there are no
> bindings.

  I guess this is the main problem.  On the other hand, the bindings
will be in most cases needed to evaluate the whole expression.  So for
implementations that do not support this namespace declaration
mechanism, the binding should then be declared in another way,
depending on the implementation.  In such cases, defining the xmlns()
function to evaluate to the empty sequence or to be ignored could be

> Using a special comment has the advantage that XPath processors
> that don't understand the notation will ignore it

  The main advantage, for sure.

> (though I freely admit that "meaningful comments" have their
> drawbacks).


  This could break existing yet stuff.  The xmlns() solution won't, I
think.  Except that, I think the only differences between the two
solutions are:

  1/ with the first one, non-supporting XPath processors will try
     to call the function xmlns()

  2/ the second one is using comments

  BTW, is it better the non-supporting XPath processors ignore the
declarations or failed to evaluate the expression?  On the one hand,
with the special comments the same expression can be used by all
processors (but we have to declare namespace bindings in another way
for non-supporting processors), and on the other hand with xmlns() a
clear error message will be displayed when using such an expression
with a non-supporting processor ("error because xmlns() function not
known at position xx").




Dicouvrez une nouvelle fagon d'obtenir des riponses ` toutes vos questions ! 
Profitez des connaissances, des opinions et des expiriences des internautes sur Yahoo! Questions/Riponses

Current Thread