Class XalanXPathExecuter

java.lang.Object
net.sf.jasperreports.xalan.util.XalanXPathExecuter
All Implemented Interfaces:
JRXPathExecuter
Direct Known Subclasses:
XalanNsAwareXPathExecuter

public class XalanXPathExecuter extends Object implements JRXPathExecuter
XPath executer implementation that uses Apache Xalan.
Author:
Lucian Chirita (lucianc@users.sourceforge.net)
  • Field Details

    • EXCEPTION_MESSAGE_KEY_XPATH_SELECTION_FAILURE

      public static final String EXCEPTION_MESSAGE_KEY_XPATH_SELECTION_FAILURE
      See Also:
  • Constructor Details

    • XalanXPathExecuter

      public XalanXPathExecuter()
      Default constructor.
  • Method Details

    • selectNodeList

      public NodeList selectNodeList(Node contextNode, String expression) throws JRException
      Description copied from interface: JRXPathExecuter
      Selects a node list by evaluating an XPath expression on a context node.
      Specified by:
      selectNodeList in interface JRXPathExecuter
      Parameters:
      contextNode - the context node (a document can also be used)
      expression - the XPath expression
      Returns:
      the selected node list
      Throws:
      JRException - if the XPath evaluation failed
    • selectObject

      public Object selectObject(Node contextNode, String expression) throws JRException
      Description copied from interface: JRXPathExecuter
      Selects an object by evaluating an XPath expression on a context node.

      If the expression evaluates to a node list, the first node in the list should be returned. Otherwise, the primitive value resulted from the evaluation should be returned as a java.lang.String, java.lang.Number or java.lang.Boolean.

      Specified by:
      selectObject in interface JRXPathExecuter
      Parameters:
      contextNode - the context node (a document can also be used)
      expression - the XPath expression
      Returns:
      the selected node or value
      Throws:
      JRException - if the XPath evaluation failed