Project

Profile

Help

Bug #3066

closed

Specialist name() treatment of XHTML elements

Added by John Lumley over 7 years ago. Updated over 6 years ago.

Status:
Rejected
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
2016-12-12
Due date:
% Done:

0%

Estimated time:
Applies to JS Branch:
0.9
Fix Committed on JS Branch:
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

DomUtils.nameoOfNode() treats elements in the namespace http://www.w3.org/1999/xhtml as a special case - returning a QName with a blank (@""@) URI. This of course has the advantage that within normal SaxonJS operation XPath expressions automatically apply to either HTML or XHTML elements in the document.

There are however some consequences of this:

  1. Using a namespace prefix bound to http://www.w3.org/1999/xhtml within an XPath expression doesn't match elements within that namespace, as their name() is returned in the "" uri namespace, but this is checked against @http://www.w3.org/1999/xhtml@.

  2. Setting the xpath-default-namespace="http://www.w3.org/1999/xhtml" has similar effect - no elements in that namespace are now retrieved from unprefixed names in an XPath expression

In cases where the XPath expression is dynamic, such as in xsl:evaluate or in the forthcoming XPath API, this becomes more complicated as it is still not possible to select XHTML elements via a bound prefix.

Please register to edit this issue

Also available in: Atom PDF Tracking page