/** * Use an XPath string to select a nodelist. * XPath namespace prefixes are resolved from the namespaceNode. * * @param contextNode The node to start searching from. * @param str A valid XPath string. * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces. * @return A NodeIterator, should never be null. * * @throws TransformerException */ public static NodeIterator selectNodeIterator( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Have the XObject return its result as a NodeSetDTM. return list.nodeset(); }
/** * Use an XPath string to select a nodelist. * XPath namespace prefixes are resolved from the namespaceNode. * * @param contextNode The node to start searching from. * @param str A valid XPath string. * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces. * @return A NodeIterator, should never be null. * * @throws TransformerException */ public NodeIterator selectNodeIterator( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Have the XObject return its result as a NodeSetDTM. return list.nodeset(); }
/** * Use an XPath string to select a nodelist. * XPath namespace prefixes are resolved from the namespaceNode. * * @param contextNode The node to start searching from. * @param str A valid XPath string. * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces. * @return A NodeIterator, should never be null. * * @throws TransformerException */ public NodeIterator selectNodeIterator( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Have the XObject return its result as a NodeSetDTM. return list.nodeset(); }
/** * Use an XPath string to select a nodelist. * XPath namespace prefixes are resolved from the namespaceNode. * * @param contextNode The node to start searching from. * @param str A valid XPath string. * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces. * @return A NodeIterator, should never be null. * * @throws TransformerException */ public static NodeIterator selectNodeIterator( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Have the XObject return its result as a NodeSetDTM. return list.nodeset(); }
private Object getResultAsType( XObject resultObject, QName returnType ) throws javax.xml.transform.TransformerException { // XPathConstants.STRING if ( returnType.equals( XPathConstants.STRING ) ) { return resultObject.str(); } // XPathConstants.NUMBER if ( returnType.equals( XPathConstants.NUMBER ) ) { return new Double ( resultObject.num()); } // XPathConstants.BOOLEAN if ( returnType.equals( XPathConstants.BOOLEAN ) ) { return new Boolean( resultObject.bool()); } // XPathConstants.NODESET ---ORdered, UNOrdered??? if ( returnType.equals( XPathConstants.NODESET ) ) { return resultObject.nodelist(); } // XPathConstants.NODE if ( returnType.equals( XPathConstants.NODE ) ) { NodeIterator ni = resultObject.nodeset(); //Return the first node, or null return ni.nextNode(); } String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString()}); throw new IllegalArgumentException( fmsg ); }
NodeIterator ni = resultObject.nodeset();
private Object getResultAsType( XObject resultObject, QName returnType ) throws javax.xml.transform.TransformerException { // XPathConstants.STRING if ( returnType.equals( XPathConstants.STRING ) ) { return resultObject.str(); } // XPathConstants.NUMBER if ( returnType.equals( XPathConstants.NUMBER ) ) { return new Double ( resultObject.num()); } // XPathConstants.BOOLEAN if ( returnType.equals( XPathConstants.BOOLEAN ) ) { return resultObject.bool() ? Boolean.TRUE : Boolean.FALSE; } // XPathConstants.NODESET ---ORdered, UNOrdered??? if ( returnType.equals( XPathConstants.NODESET ) ) { return resultObject.nodelist(); } // XPathConstants.NODE if ( returnType.equals( XPathConstants.NODE ) ) { NodeIterator ni = resultObject.nodeset(); //Return the first node, or null return ni.nextNode(); } String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString()}); throw new IllegalArgumentException( fmsg ); }
NodeIterator ni = resultObject.nodeset();
result = m_resultObj.nodeset(); } catch (TransformerException te) { throw new XPathException(XPathException.TYPE_ERR,te.getMessage());
NodeListModel result = new NodeListModel(node); result.xpathSupport = this; NodeIterator nodeIterator = xresult.nodeset(); Node n; do {
(javaClass == java.lang.Object.class) ) return xobj.nodeset();
m_iterator = m_resultObj.nodeset(); } catch (TransformerException te) {
/** * Use an XPath string to select a nodelist. * XPath namespace prefixes are resolved from the namespaceNode. * * @param contextNode The node to start searching from. * @param str A valid XPath string. * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces. * @return A NodeIterator, should never be null. * * @throws TransformerException */ public static NodeIterator selectNodeIterator( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Have the XObject return its result as a NodeSetDTM. return list.nodeset(); }
/** * Use an XPath string to select a nodelist. * XPath namespace prefixes are resolved from the namespaceNode. * * @param contextNode The node to start searching from. * @param str A valid XPath string. * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces. * @return A NodeIterator, should never be null. * * @throws TransformerException */ public NodeIterator selectNodeIterator( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Have the XObject return its result as a NodeSetDTM. return list.nodeset(); }
/** * Use an XPath string to select a nodelist. * XPath namespace prefixes are resolved from the namespaceNode. * * @param contextNode The node to start searching from. * @param str A valid XPath string. * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces. * @return A NodeIterator, should never be null. * * @throws TransformerException */ public static NodeIterator selectNodeIterator( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Have the XObject return its result as a NodeSetDTM. return list.nodeset(); }
/** * Use an XPath string to select a nodelist. * XPath namespace prefixes are resolved from the namespaceNode. * * @param contextNode The node to start searching from. * @param str A valid XPath string. * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces. * @return A NodeIterator, should never be null. * * @throws TransformerException */ public NodeIterator selectNodeIterator( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Have the XObject return its result as a NodeSetDTM. return list.nodeset(); }
/** * Use an XPath string to select a nodelist. * XPath namespace prefixes are resolved from the namespaceNode. * * @param contextNode The node to start searching from. * @param str A valid XPath string. * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces. * @return A NodeIterator, should never be null. * * @throws TransformerException */ public static NodeIterator selectNodeIterator( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Have the XObject return its result as a NodeSetDTM. return list.nodeset(); }
/** * Use an XPath string to select a nodelist. * XPath namespace prefixes are resolved from the namespaceNode. * * @param contextNode The node to start searching from. * @param str A valid XPath string. * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces. * @return A NodeIterator, should never be null. * * @throws TransformerException */ public NodeIterator selectNodeIterator( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Have the XObject return its result as a NodeSetDTM. return list.nodeset(); }
/** * Returns a NodeIterator from an XObject. * @param list The XObject from which a NodeIterator is returned. * @return A NodeIterator, should never be null. * @throws JspTagException */ private static NodeIterator getNodeIterator(XObject list) throws JspTagException { try { return list.nodeset(); } catch (TransformerException ex) { throw new JspTagException( Resources.getMessage("XPATH_ERROR_XOBJECT", ex.toString()), ex); } }