KindTests

The syntax for the element() and attribute() KindTests is extended to allow constructs of the form

element(*:div)

or

attribute(myns:*, myns:someType)

More specifically, the grammar for ElementNameOrWildCard changes from ElementName | "*" to simply NameTest; and similarly AttribNameOrWildCard also expands simply to NameTest. This change is made largely for orthogonality reasons (there is no reason to have different rules for the two constructs) and also because it provides some useful extra functionality: for example in XSLT it is now possible to match all elements in a particular namespace having a particular type with a template rule that specifies match="element(my:*, my:type)".

The default priority for an XSLT pattern in the form element(X) is always the same as the default priority for X, so for example the default priority of element(my:*) is -0.25. If a type is present, then we follow the principle that the default priority of element(my:*, T) is midway between the priorities of element(*, T) and element(E, T): that is, 0.125.