/** * Evaluate an XPath expression to a List of nodes. */ public List selectNodes(Node contextNode, String xpathString) throws JspTagException { XPathVariableResolver jxvr = new JSTLXPathVariableResolver(pageContext); try { XPath xpath = XPATH_FACTORY.newXPath(); xpath.setNamespaceContext(jstlXPathNamespaceContext); xpath.setXPathVariableResolver(jxvr); Object nl = xpath.evaluate( xpathString, contextNode, JSTLXPathConstants.OBJECT); return new JSTLNodeList( nl ); } catch (XPathExpressionException ex ) { throw new JspTagException(ex.toString(), ex); } }
/** * Evaluate an XPath expression to a List of nodes. */ public List selectNodes(Node n, String xpathString) throws JspTagException { staticInit(); XPathVariableResolver jxvr = new JSTLXPathVariableResolver(pageContext); Node contextNode = adaptParamsForXalan(n, xpathString.trim(), jxvr); xpathString = modifiedXPath; try { XPath xpath = XPATH_FACTORY.newXPath(); xpath.setNamespaceContext(jstlXPathNamespaceContext); xpath.setXPathVariableResolver(jxvr); Object nl = xpath.evaluate( xpathString, contextNode, JSTLXPathConstants.OBJECT); return new JSTLNodeList( nl ); } catch (XPathExpressionException ex ) { throw new JspTagException(ex.toString(), ex); } }
/** * Evaluate an XPath expression to a List of nodes. */ public List selectNodes(Node n, String xpathString) throws JspTagException { staticInit(); XPathVariableResolver jxvr = new JSTLXPathVariableResolver(pageContext); Node contextNode = adaptParamsForXalan(n, xpathString.trim(), jxvr); xpathString = modifiedXPath; try { XPath xpath = XPATH_FACTORY.newXPath(); xpath.setNamespaceContext(jstlXPathNamespaceContext); xpath.setXPathVariableResolver(jxvr); Object nl = xpath.evaluate( xpathString, contextNode, JSTLXPathConstants.OBJECT); return new JSTLNodeList( nl ); } catch (XPathExpressionException ex ) { throw new JspTagException(ex.toString(), ex); } }
/** * Evaluate an XPath expression to a List of nodes. */ public List selectNodes(Node n, String xpathString) throws JspTagException { staticInit(); XPathVariableResolver jxvr = new JSTLXPathVariableResolver(pageContext); Node contextNode = adaptParamsForXalan(n, xpathString.trim(), jxvr); xpathString = modifiedXPath; try { XPath xpath = XPATH_FACTORY.newXPath(); xpath.setNamespaceContext(jstlXPathNamespaceContext); xpath.setXPathVariableResolver(jxvr); Object nl = xpath.evaluate( xpathString, contextNode, JSTLXPathConstants.OBJECT); return new JSTLNodeList( nl ); } catch (XPathExpressionException ex ) { throw new JspTagException(ex.toString(), ex); } }
/** * Evaluate an XPath expression to a List of nodes. */ public List selectNodes(Node n, String xpathString) throws JspTagException { staticInit(); XPathVariableResolver jxvr = new JSTLXPathVariableResolver(pageContext); Node contextNode = adaptParamsForXalan(n, xpathString.trim(), jxvr); xpathString = modifiedXPath; try { XPath xpath = XPATH_FACTORY.newXPath(); xpath.setNamespaceContext(jstlXPathNamespaceContext); xpath.setXPathVariableResolver(jxvr); Object nl = xpath.evaluate( xpathString, contextNode, JSTLXPathConstants.OBJECT); return new JSTLNodeList( nl ); } catch (XPathExpressionException ex ) { throw new JspTagException(ex.toString(), ex); } }
JSTLNodeList jstlNodeList = new JSTLNodeList( nodeVector); newXObject = new XNodeSetForDOM( jstlNodeList, xctxt ); newXObject = new XNodeSetForDOM ( new JSTLNodeList( (Node)varObject ),xctxt ); } else if ( Class.forName("java.lang.String").isInstance( varObject)){ newXObject = new XString ( (String)varObject );
try { NodeList nl= JSTLXPathAPI.getNodeList(result); return new JSTLNodeList( nl ); } catch ( JspTagException e ) { try { return new JSTLNodeList ( vector ); } catch ( TransformerException te ) { throw new JspTagException(te.toString(), te);