Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
A
NameTest
of the form
*:code
matches any node whose local-name is
code
, regardless of its namespace (it will match names in any namespace, as well as names that are in no namespace).
The
NameTest
xyz:code
matches any name whose namespace is the one currently bound to the namespace prefix
xyz
and whose local part is
code
. Again, the name being tested doesn't need to use the same prefix, provided it refers to the same namespace URI.
The interpretation of a
NameTest
such as
code
(with no namespace prefix) depends on the context:
If your source document uses a default namespace declaration such as
xmlns = “some.uri”
, then a
element in the source document will not be selected by an XPath expression such as
//code
, even if the stylesheet contains the same namespace declaration
xmlns=“some.uri”
. This is because in the XPath expression, the default namespace is ignored. You will either need to specify an explicit namespace declaration such as
xmlns:x=“some.uri”
and refer to the element as
//x:item
, or to declare an
xpath-default-namespace
in the stylesheet.