/** * Method evals a path on a NodeList. * * @param nodeList the nodeList. * @return Object. * @throws XPathExpressionException if error occurs. */ private Object evalNodeList(final NodeList nodeList) throws XPathExpressionException { if (getReturnType() != XPathConstants.NODESET) { for (int i = 0, l = nodeList.getLength(); i < l; ++i) { Object result = m_xPath.evaluate(nodeList.item(i), getReturnType()); if (result != null) { return result; } } return null; } else { SimpleNodeList resultNodes = new SimpleNodeList(); for (int i = 0, l = nodeList.getLength(); i < l; ++i) { resultNodes.addAll((NodeList) m_xPath.evaluate(nodeList.item(i), getReturnType())); } return resultNodes; } }
if (XPathConstants.STRING == m_previous.getReturnType()) { + "this works only if the string is wellformed xml"); return m_xPath.evaluate(new InputSource(new StringReader((String) m_previous.eval())), getReturnType()); } else if (XPathConstants.NODE == m_previous.getReturnType()) { return m_xPath.evaluate(m_previous.eval(), getReturnType()); } else if (XPathConstants.NODESET == m_previous.getReturnType()) { } else if (m_previous.getReturnType() == null) { return m_xPath.evaluate((InputSource) m_previous.eval(), getReturnType()); } else if (XPathConstants.NUMBER == m_previous.getReturnType()) { } else if (XPathConstants.BOOLEAN == m_previous.getReturnType()) { "return type of unknown format expected <" + m_previous.getReturnType() + ">");