//
// If the type is not a supported type, throw an exception and be
// done with it!
if (!XPathResultImpl.isValidType(type)) {
String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_INVALID_XPATH_TYPE, new Object[] {new Integer(type)});
throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0}
}
// Cache xpath context?
XPathContext xpathSupport = new XPathContext();
// if m_document is not null, build the DTM from the document
if (null != m_doc) {
xpathSupport.getDTMHandleFromNode(m_doc);
}
XObject xobj = null;
try {
xobj = m_xpath.execute(xpathSupport, contextNode, m_resolver );
} catch (TransformerException te) {
// What should we do here?
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation());
}
// Create a new XPathResult object
// Reuse result object passed in?
// The constructor will check the compatibility of type and xobj and