Package org.jaxen

Examples of org.jaxen.XPath.evaluate()


        doc.appendChild(a);
        Text b = doc.createTextNode("ready");
        a.appendChild(b);
       
        XPath xpath = new DOMXPath("..");
        List result = (List) xpath.evaluate(b);
        assertEquals(1, result.size());
        assertEquals(a, result.get(0));
  
    }
   
View Full Code Here


        Text b = doc.createTextNode("ready");
        a.appendChild(b);
       
        XPath xpath = new DOMXPath("..");
        try {
            xpath.evaluate("String");
            fail("Allowed String as context");
        }
        catch (ClassCastException ex) {
            // success
        }
View Full Code Here

       
        XPath xpath = new DOMXPath( "name(//c/preceding::*[1])" );
        DocumentBuilder builder = factory.newDocumentBuilder();
   
        doc = builder.parse("xml/web2.xml");
        Object result = xpath.evaluate(doc);
        assertEquals("d", result);
    }
   

    public void testJaxen207()
View Full Code Here

    Map<QName,Function> functions,
    Map<QName,Object> variables) throws XPathException {
    try {
      base = getElementWrapped(base);
      XPath xpath = getXPath(path, namespaces, functions, variables);
      return xpath.evaluate(base);
    } catch (JaxenException e) {
      throw new XPathException(e);
    }
  }
View Full Code Here

                           Map<QName, Function> functions,
                           Map<QName, Object> variables) throws XPathException {
        try {
            base = getElementWrapped(base);
            XPath xpath = getXPath(path, namespaces, functions, variables);
            return xpath.evaluate(base);
        } catch (JaxenException e) {
            throw new XPathException(e);
        }
    }
View Full Code Here

    Map<String,String> namespaces,
    Map<QName,Function> functions,
    Map<QName,Object> variables) throws XPathException {
    try {
      XPath xpath = getXPath(path, namespaces, functions, variables);
      return xpath.evaluate(base);
    } catch (JaxenException e) {
      throw new XPathException(e);
    }
  }
View Full Code Here

    }

    public void testEqualsTwoNodesets() throws JaxenException
    {
        XPath xpath = new DOMXPath( "//b = //c" );
        Boolean result = (Boolean) xpath.evaluate( doc );
        assertTrue( result.booleanValue() );
    }

    public void testNotEqualsTwoNodesets() throws JaxenException
    {
View Full Code Here

    }

    public void testNotEqualsTwoNodesets() throws JaxenException
    {
        XPath xpath = new DOMXPath( "//a != //b" );
        Boolean result = (Boolean) xpath.evaluate( doc );
        assertTrue( result.booleanValue() );
    }

    public void testEqualsStringNodeset() throws JaxenException
    {
View Full Code Here

    }

    public void testEqualsStringNodeset() throws JaxenException
    {
        XPath xpath = new DOMXPath( "//b = 'blort'" );
        Boolean result = (Boolean) xpath.evaluate( doc );
        assertTrue(result.booleanValue());
    }

    public void testNotEqualsStringNodeset() throws JaxenException
    {
View Full Code Here

    }

    public void testNotEqualsStringNodeset() throws JaxenException
    {
        XPath xpath = new DOMXPath( "//b != 'phooey'" );
        Boolean result = (Boolean) xpath.evaluate( doc );
        assertTrue(result.booleanValue());
    }

    public void testEqualsNumberNodeset() throws JaxenException
    {
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.