JDK-8054197 : org.w3c.dom.xpath visible but not accessibile
  • Type: Sub-task
  • Component: xml
  • Sub-Component: org.w3c.dom
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-08-01
  • Updated: 2017-05-19
  • Resolved: 2015-04-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Related Reports
Relates :  
Relates :  
org.w3c.dom.xpath has existed in JDK/JAXP API package as part of org.w3c.dom package. However, it has not been included in the specification. Part of the reason could be that JDK/JAXP defines a separate javax.xml.xpath API.

Regardless of the JAXP specification, org.w3c.dom.xpath has always been public. More importantly, it provides features such as the support for any type that is missing from javax.xml.xpath (refer to JDK-8054196). For this reason, and to allow users to continue using the API after modularization, I hereby propose to make org.w3c.dom.xpath a formal part of the standard API.

JDK-8042244 has been resolved. org.w3c.dom.xpath is exported from jdk.xml.dom module.

From the Maven Central search, the types that reference org.w3c.dom.xpath are in a few packages: org.apache.xpath.domapi org.apache.batik.bridge.svg12 org.apache.batik.dom com.sun.org.apache.xpath.internal.domapi These packages are from a few project and got redistributed from 47 JAR files in the Maven Central. These projects may likely have dependencies on W3C DOM not from JDK. Derby's dependency on org.w3c.dom.xpath is addressed by JDK-8054196. org.w3c.dom.xpath is not widely used. Two options are considered: 1. Rename org.w3c.dom.xpath in java.xml module for internal use (JAXP depends on DOM xpath implementation). These projects will have to ensure the dependency on org.w3c.dom.xpath from another source when running on JDK 9. 2. Do the rename in java.xml module. Include org.w3c.dom.xpath (just interfaces no implementation) in a JDK-specific module for compatibility reason.

Some more details behind WebView/XPath can be found here: https://javafx-jira.kenai.com/browse/RT-30698

We rely on this package for the WebView feature in JavaFX. I checked with Anton Tarasov and he had this to say: It's used to implement the DOM XPath functionality [1] per org.w3c.dom.Document (com.sun.webkit.dom.DocumentImpl). For instance: public XPathExpression createExpression(String expression, XPathNSResolver resolver) public XPathNSResolver createNSResolver(Node nodeResolver) We simply wrap native objects (managed by WebKit + libxslt) with org.w3c.dom.xpath interfaces impls. javax.xml.xpath could theoretically be used instead. However, I can't find XPathNSResolver in it, at least. Also, in javadoc [2] I see the following: <<This package provides an object-model neutral API for the evaluation of XPath expressions>> So, seems it doesn't have direct mapping to the DOM XPath API interfaces [1]. There may be problems with it for us. [1] http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html [2] http://docs.oracle.com/javase/8/docs/api/javax/xml/xpath/package-summary.html