[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Proposed syntax for namespace binding in XPath

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

  Hi

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

> xmlns(abc=http://example.com/ns/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:

    xmlns(http://example.com/)

> 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
possible.

> 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).

  Indeed.

  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").

  Regards,

--drkm





















	

	
		
___________________________________________________________________________ 
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 
http://fr.answers.yahoo.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.