Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7003147

DOMImplementation.getFeature() requires "+" prefix for XPath, contrary to spec

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • 6u23
    • xml
    • x86
    • solaris_nevada

      The javadoc for org.w3c.dom.DOMImplementation.getFeature(String,String) says the following about the feature parameter:

      feature - The name of the feature requested. Note that any plus sign "+" prepended to the name of the feature will be ignored since it is not significant in the context of this method.

      But in the following code it looks like the plus sign is significant:

              Document doc = DocumentBuilderFactory.newInstance().
                      newDocumentBuilder().newDocument();

              DOMImplementation impl = doc.getImplementation();

              System.out.println(impl.getFeature("XPath", "3.0"));
              System.out.println(impl.getFeature("+XPath", "3.0"));

      The first call to getFeature() returns null. The second call, in which "+" has been prepended to the name of the feature, returns an instance of com.sun.org.apache.xpath.internal.domapi.XPathEvaluatorImpl.

            joehw Joe Wang
            khatlen Knut Anders Hatlen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: