[xsl] RE: RE: Re: Query re XMLSpy XPath engine

Subject: [xsl] RE: RE: Re: Query re XMLSpy XPath engine
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Tue, 23 Jul 2002 05:05:17 -0700 (PDT)
--- Américo Albuquerque <aalbuquerque at viseu dot ipiaget dot pt>
wrote:
> Hi!
> In this document we have two ns defenitions: one binding the ns
> 'http://www.w3.org/1999/xhtml' to the prefix 'html' and another
> setting
> the default ns to 'http://www.w3.org/1999/xhtml'. Since XMLSpy
> evaluates
> the expression in the context of the original document doesn't this
> means that it's setting the html prefix or setting the default ns??
> Wich
> ns definition is return with //hr?
> xmlns="http://www.w3.org/1999/xhtml";;
> or xmlns:html="http://www.w3.org/1999/xhtml";;??


The spec says that a non-prefixed name means a name in the ***null***
namespace, not the default namespace. 

"A QName in the node test is expanded into an expanded-name using the
namespace declarations from the expression context. This is the same
way expansion is done for element type names in start and end-tags
except that the default namespace declared with xmlns is not used: if
the QName does not have a prefix, then the namespace URI is null"

(http://www.w3.org/TR/xpath#node-tests)

Therefore, if the default namespace is not null (,which is the case)
the result of evaluating the XPath expression "//hr " will not contain
"hr" elements from the default namespace.

On the other side, "//html:hr " will return all of them.



=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread