Package org.jaxen

Examples of org.jaxen.XPath.evaluate()


  public NodeList selectNodeList(Node contextNode, String expression) throws JRException
  {
    try
    {
      XPath xpath = getXPath(contextNode, expression);
      Object object = xpath.evaluate(contextNode);
      List nodes;
      if (object instanceof List)
      {
        nodes = (List) object;
      }
View Full Code Here


  public Object selectObject(Node contextNode, String expression) throws JRException
  {
    try
    {
      XPath xpath = getXPath(contextNode, expression);
      Object object = xpath.evaluate(contextNode);
      Object value;
      if (object instanceof List)
      {
        List list = (List) object;
        if (list.isEmpty())
View Full Code Here

  public NodeList selectNodeList(Node contextNode, String expression) throws JRException
  {
    try
    {
      XPath xpath = getXPath(expression);
      Object object = xpath.evaluate(contextNode);
      List nodes;
      if (object instanceof List)
      {
        nodes = (List) object;
      }
View Full Code Here

  public Object selectObject(Node contextNode, String expression) throws JRException
  {
    try
    {
      XPath xpath = new DOMXPath(expression);
      Object object = xpath.evaluate(contextNode);
      Object value;
      if (object instanceof List)
      {
        List list = (List) object;
        if (list.isEmpty())
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

        }
        try
        {
            XPath xpath = new DOMXPath( xpathExpr.getValue() );
            xpath.setNamespaceContext( new JaxenNamespaceContext( xpathExpr.getNamespaceContext() ) );
            return xpath.evaluate( evalContextNode );
        }
        catch ( JaxenException je )
        {
            throw new QueryEvaluationErrorException( MSG.getMessage( Keys.XPATH_FAILED, xpathExpr.getValue(),
                    je ) );
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

       
    }
   
    public void testArithmeticAssociativity() throws JaxenException {
        XPath xpath = new DOMXPath("2+1-1+1");
        Double result = (Double) xpath.evaluate(doc);
        assertEquals(3, result.intValue());
    }
   
    public void testLogicalAssociativity() throws JaxenException {
        XPath xpath = new DOMXPath("false() or true() and true() and false()");
View Full Code Here

        assertEquals(3, result.intValue());
    }
   
    public void testLogicalAssociativity() throws JaxenException {
        XPath xpath = new DOMXPath("false() or true() and true() and false()");
        Boolean result = (Boolean) xpath.evaluate(doc);
        assertFalse(result.booleanValue());
    }
   
    public void testRelationalAssociativity3() throws JaxenException {
        XPath xpath = new DOMXPath("3 > 2 > 1");
View Full Code Here

        assertFalse(result.booleanValue());
    }
   
    public void testRelationalAssociativity3() throws JaxenException {
        XPath xpath = new DOMXPath("3 > 2 > 1");
        Boolean result = (Boolean) xpath.evaluate(doc);
        assertFalse(result.booleanValue());
    }
   
    public void testRelationalAssociativity4() throws JaxenException {
        XPath xpath = new DOMXPath("4 > 3 > 2 > 1");
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.