Package org.jaxen

Examples of org.jaxen.XPath


    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.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.stringValueOf(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.booleanValueOf(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.numberValueOf(base);
    } catch (JaxenException e) {
      throw new XPathException(e);
    }
  }
View Full Code Here

        Iterator elementsIter = elements.iterator();
        while (elementsIter.hasNext())
        {
                String expression = (String)elementsIter.next();
                try {
                                XPath xp = new AXIOMXPath(expression);
                                Iterator nsIter = namespaces.iterator();
                               
                                while (nsIter.hasNext())
                                {
                                        OMNamespace tmpNs = (OMNamespace)nsIter.next();
                                        xp.addNamespace(tmpNs.getPrefix(), tmpNs.getNamespaceURI());
                                }
                               
                                List selectedNodes = xp.selectNodes(envelope);
                               
                                Iterator nodesIter = selectedNodes.iterator();
                               
                            while (nodesIter.hasNext())
                            {
View Full Code Here

        Iterator elementsIter = elements.iterator();
        while (elementsIter.hasNext())
        {
          String expression = (String)elementsIter.next();
          try {
        XPath xp = new AXIOMXPath(expression);
        Iterator nsIter = namespaces.iterator();
       
        while (nsIter.hasNext())
        {
          OMNamespace tmpNs = (OMNamespace)nsIter.next();
          xp.addNamespace(tmpNs.getPrefix(), tmpNs.getNamespaceURI());
        }
       
        List selectedNodes = xp.selectNodes(envelope);
       
        Iterator nodesIter = selectedNodes.iterator();
          while (nodesIter.hasNext())
          {
            OMElement e = (OMElement)nodesIter.next();
View Full Code Here

       
       
        Set namespaces = findAllPrefixNamespaces(envelope, decNamespaces);

        try {
                        XPath xp = new AXIOMXPath(expression);
                        Iterator nsIter = namespaces.iterator();
                       
                        while (nsIter.hasNext())
                        {
                                OMNamespace tmpNs = (OMNamespace)nsIter.next();
                                xp.addNamespace(tmpNs.getPrefix(), tmpNs.getNamespaceURI());
                        }
                       
                        List selectedNodes = xp.selectNodes(envelope);
                       
                        if (selectedNodes.size() == 0 ) {
                            return false;
                        }
               
View Full Code Here

        try {

            HashMap map = new HashMap();
            map.put("default", XmlConstants.POM_DEFAULT_NAMESPACE);

            XPath xpath = new Dom4jXPath("/default:project/default:dependencies");
            xpath.setNamespaceContext(new SimpleNamespaceContext(map));
           
            dependenciesNode = (DefaultElement)xpath.selectSingleNode(pomDocument);
            readDependenciesListFromXmlNode(dependencies, dependenciesNode);
        }
        catch (JaxenException e) {
            e.printStackTrace();
        }
View Full Code Here

    }
   
    public static void loadSettingsSection(final String xPathString, final Object parent,
            final DeployerSettings deployerSettings) throws JaxenException {
       
        XPath xpath = new Dom4jXPath(xPathString);
        Node settings = (Node)xpath.selectSingleNode(parent);
       
        if (null != settings) {
            deployerSettings.useIndex = XmlUtils.getChildNodeBooleanValue(settings,
                    XmlConstants.USE_INDEX, deployerSettings.useIndex);
        }
View Full Code Here

                String prefix = "./";
                if (usePomNamespace) {
                    prefix += "default:";
                }
                XPath xpath = new Dom4jXPath(prefix + childName);
                xpath.setNamespaceContext(new SimpleNamespaceContext(map));

                Node child = (Node) xpath.selectSingleNode(parent);
                if (null != child) {
                    if (null != child.getText()) {
                        result = child.getText().trim();
                    }
                }
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.