Package org.apache.xpath

Examples of org.apache.xpath.XPath.execute()


    if(null != fileNameExpr)
    {
      org.apache.xpath.XPathContext xctxt
        = context.getTransformer().getXPathContext();
      XPath myxpath = new XPath(fileNameExpr, elem, xctxt.getNamespaceContext(), XPath.SELECT);
      XObject xobj = myxpath.execute(xctxt, context.getContextNode(), elem);
      fileName = xobj.str();
      if((null == fileName) || (fileName.length() == 0))
      {
        fileName = elem.getAttribute ("file",
                                      context.getContextNode(),
View Full Code Here


      try
      {
        XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(),
                                       xctxt.getNamespaceContext(),
                                       XPath.SELECT);
        result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num();
      }
      catch (TransformerException e)
      {
        xctxt.popCurrentNode();
        xctxt.popContextNodeList();
View Full Code Here

      try
      {
        XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(),
                                       xctxt.getNamespaceContext(),
                                       XPath.SELECT);
        result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num();
      }
      catch (TransformerException e)
      {
        xctxt.popCurrentNode();
        xctxt.popContextNodeList();
View Full Code Here

      try
      {
        XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(),
                                       xctxt.getNamespaceContext(),
                                       XPath.SELECT);
        result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num();
      }
      catch (TransformerException e)
      {
        xctxt.popCurrentNode();
        xctxt.popContextNodeList();
View Full Code Here

      try
      {
        XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(),
                                       xctxt.getNamespaceContext(),
                                       XPath.SELECT);
        object = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext());
       
        if (object instanceof XNodeSet)
        {
          NodeList nodelist = null;
          nodelist = ((XNodeSet)object).nodelist();
View Full Code Here

        xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext();
        XPath dynamicXPath = new XPath(xpathExpr, xctxt.getSAXLocator(),
                                       xctxt.getNamespaceContext(),
                                       XPath.SELECT);

        return dynamicXPath.execute(xctxt, myContext.getContextNode(),
                                    xctxt.getNamespaceContext());
      }
      catch (TransformerException e)
      {
        return new XNodeSet(xctxt.getDTMManager());
View Full Code Here

        try
        {
          XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(),
                                         xctxt.getNamespaceContext(),
                                         XPath.SELECT);
          object = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext());
         
          if (object instanceof XNodeSet)
          {
            NodeList nodelist = null;
            nodelist = ((XNodeSet)object).nodelist();
View Full Code Here

        XPath last = new XPath("last()", null, null, XPath.SELECT);
        tag.prepare();
        XPathContext context = tag.getContext();
        tag.hasNext();
        tag.next();
        Assert.assertEquals("3", last.execute(context, context.getCurrentNode(), null).str());
        Assert.assertEquals("one", dot.execute(context, context.getCurrentNode(), null).str());
        Assert.assertEquals("1", position.execute(context, context.getCurrentNode(), null).str());
        tag.hasNext();
        tag.next();
        Assert.assertEquals("two", dot.execute(context, context.getCurrentNode(), null).str());
View Full Code Here

        expect(pageContext.findAttribute("a")).andReturn("Hello");
        expect(pageContext.getAttribute("b", PageContext.REQUEST_SCOPE)).andReturn("World");
        replay(pageContext, tag);
        XPathContext context = XalanUtil.getContext(tag, pageContext);
        XPath xpath = new XPath("concat($a, ' ', $requestScope:b)", null, null, XPath.SELECT);
        Assert.assertEquals("Hello World", xpath.execute(context, context.getCurrentNode(), null).str());
        verify(pageContext, tag);
    }
}
View Full Code Here

          XpathTable.put(path,xpath);
        }

        // Execute the XPath, and have it return the result
        int ctxtNode = xpathSupport.getDTMHandleFromNode(data);
        return xpath.execute(xpathSupport, ctxtNode, prefixResolver);
    }

    public void setup(String value, String loadResource, String saveResource) {
        this.name = value;
        this.loadResource = loadResource;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.