Re: Default namespaces in XPath

Well
I think that if you're talking about an XPath 1.0 implementation that should
behave the same way as if

[[
Default element/type namespace

    The null namespace.
Default function namespace

    The [XPath 2.0] function namespace.
]]

But in XPath 1.0, we didn't have this terminology but we already have

In 2.3 Node Tests

[[
if the QName <http://www.w3.org/TR/REC-xml-names#NT-QName> does not have a
prefix, then the namespace URI is null
]]


But to be fair, we don't have the clarity of that vis à vis FunctionCall to
know if without prefix it is in "null" namespace or something like...

Cheers,

Xmlizer


2009/4/27 Toman_Vojtech <Toman_Vojtech@emc.com>

> Suppose I have a pipeline that looks like this:
>
> <p:pipeline xmlns:p="http://www.w3.org/ns/xproc" xmlns="http://foo.com">
>  <p:choose>
>    <p:when test="... contains(., 'bar') ...">...</p:when>
>    <p:otherwise>...</p:otherwise>
>  </p:choose>
> </p:pipeline>
>
> Does the XPath expression evaluate without errors, or not? I just
> discovered that with our implementation, it does not, because:
>
> 1. The default namespace is "http://foo.com",
> 2. the default namespace is included in the set of in-scope namespaces of
> the processor XPath context (section 2.6.1.1),
> 3. the local function name contains() resolves to {http://foo.com}contains(),
> which of course does not exist
> 4. ... and the XPath expression fails
>
> It came as a sort of surprise to me, but perhaps it is just correct and
> what the XProc specification expects to happen in this case. Or is it a bug
> in our XPath handling?
>
>
> Regards,
> Vojtech
>
>

Received on Monday, 27 April 2009 10:55:16 UTC