Given the following document ...
<?xml version="1.1"?>
<doc xmlns="https://www.example.com" xmlns:n1="https://www.example.com"
a="1"
n1:a="2"/>
... (Q1) What is the canonical result of this xpath 3.1 expression ..
n2:doc/@n2:a
... if the context node is the document, and a namespace binding xmlns:n2="https://www.example.com"
is attached to the xpath processor?
(Q2) What about expression ...
doc/@a
... with a namespace binding of xmlns="https://www.example.com"
on the xpath processor?
What I've tried
I've had inconsistent results with various different xpath implementations, suggesting that this is a bit of a grey area in the XPath spec. I've even experienced a return of a sequence of two nodes, which at first blush, is an unexpected result.
References: