Re: Is default namespace also applicable to the QName in the XPath spec.?

Daniel Veillard wrote:
>> If there is a default namespace (same as the namespace
>> what prefix myNS mapped to) in scope, can we
>> simplify the above statement to be:
>> 
>>    <xsd:selector xpath=".//t/row"/>?
>
> I hope the answer is no, because XPath-1.0 states explicitely that a
> non-qualified name in an XPath step can only match nodes without a
> namespace (i.e. this won't select elements in the default
> namespace). I assume/hope XML Schemas is compatible at that level.

It's perhaps worth noting that XPath 2.0 has the "default namespace
for element and type names" as part of the static context, and thus
settable by the host language. A future version of XML Schema that
used XPath 2.0 could easily state that the default namespace for
element (and type) names was the same as the target namespace of the
schema. Whether this would be desirable in the face of unqualified
locally declared elements is another matter...

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Tuesday, 23 July 2002 04:26:10 UTC