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

Package Overview for javax.xml.xpath has error in example code

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.1, 5.0
    • xml

      A DESCRIPTION OF THE PROBLEM :
      says

      "
      Using the XPath API
      The following example demonstrates using the XPath API to select one or more nodes from an XML document:

      XPath xpath = XPathFactory.newInstance().newXPath();
      String expression = "/widgets/widget";
      InputSource inputSource = new InputSource("widgets.xml");
      NodeSet nodes = (NodeSet) xpath.evaluate(expression, inputSource, XPathConstants.NODESET);
      "

      but in the example the type NodeSet should be NodeList (2 places) (even tho' the enum is XPathConstants.NODESET) There is no class NodeSet in J2SE 5.0


      URL OF FAULTY DOCUMENTATION :
      http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/xpath/package-summary.html
      ###@###.### 2005-04-06 10:42:51 GMT

            joehw Joe Wang
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: