Package org.jaxen

Examples of org.jaxen.XPath


    this.detectXmlNamespaces = detectXmlNamespaces;
  }
 
  protected XPath getXPath(Node contextNode, String expression) throws JRException
  {
    XPath xPath = (XPath) cachedXPaths.get(expression);
    if (xPath == null)
    {
      try
      {
        xPath = new DOMXPath(expression);
View Full Code Here


 
  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

    List nlist;
    String namespaceXPathString = "//namespace::node()";

    try
    {
      XPath xpath = new DOMXPath(namespaceXPathString);
      nlist = xpath.selectNodes(contextNode);
     
            for (int i = 0; i < nlist.size(); i++)
            {
                Node node = (Node)nlist.get(i);
                if(node.getParentNode() != null && node.getParentNode().getPrefix() != null)
View Full Code Here

  {
  }
 
  protected XPath getXPath(String expression) throws JRException
  {
    XPath xPath = (XPath) cachedXPaths.get(expression);
    if (xPath == null)
    {
      try
      {
        xPath = new DOMXPath(expression);
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 JaxenException {
    DocumentNavigator nav = new DocumentNavigator();
    XPath contextpath = new BaseXPath(path, nav);
    if (namespaces != null) {
      for (Map.Entry<String, String> entry : namespaces.entrySet()) {
        contextpath.addNamespace(entry.getKey(), entry.getValue());
      }
    }
    if (functions != null) {
      contextpath.setFunctionContext(
        getFunctionContext(
          functions,
          (SimpleFunctionContext)contextpath.getFunctionContext()));
    }
    if (variables != null)
      contextpath.setVariableContext(
        getVariableContext(
          variables,
          (SimpleVariableContext)contextpath.getVariableContext()));
    return contextpath;   
  }
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.selectNodes(base);
    } catch (JaxenException e) {
      throw new XPathException(e);
    }
  }
View Full Code Here

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

TOP

Related Classes of org.jaxen.XPath

Copyright © 2018 www.massapicom. 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.