Hi Guyz

I am trying to use setSortKey to sort the xpath result. But, the output is not sorted!!! This is what I tried:

    // BufferPosition is a tag, and I want the output to be sorted based on the text content of this tag

    Document node = parser.parse("xml/test.xml");

    XPathExpressionImpl xei = (XPathExpressionImpl) xpath.compile("//BufferPosition");
    XPathExpressionImpl sortKey = (XPathExpressionImpl) xpath.compile("//BufferPosition/text()");
    NodeList xpath_value = (NodeList) xei.evaluate(node, XPathConstants.NODESET);

Any idea? Please help.