working with objects returned from evaluateXPath()
Posted: Fri Jun 27, 2014 8:45 pm
evaluateXPath() returns an array of Object. Exactly what object depends on the XPath expression but when the result is a sequence of nodes I seem to get classes from org.apache.xerces.dom. I'd like to use the appropriate methods on those objects.
Apparently evaluateXPath() returns objects that are not on the class path.
Do I need to add more to the class path?
Am I trying to do something evaluateXPath() was not intended to support?
Code: Select all
import org.apache.xerces.dom.*; // Compilte time error
...
WSXMLTextEditorPage xmlTep...
Object[] xpr = xmlTep.evaluateXPath(xp);
ws.showInformationMessage(xpr[0].getClass().getName()); // e.g. org.apache.xerces.dom.AttrImpl
String xprs = ((NodeImpl) xpr[0]).GetNodeValue(); // compile time error
Do I need to add more to the class path?
Am I trying to do something evaluateXPath() was not intended to support?