Package org.jaxen.dom4j

Examples of org.jaxen.dom4j.Dom4jXPath


    return valueOf(node);
  }

  protected static XPath parse(String text) {
    try {
      return new Dom4jXPath(text);
    } catch (JaxenException e) {
      throw new InvalidXPathException(text, e.getMessage());
    } catch (RuntimeException e) {
    }
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

        return xpath;
    }

    protected Dom4jXPath getDom4jXPath() throws JaxenException
    {
        Dom4jXPath xpath = new Dom4jXPath(pattern);
        setupNamespaces(xpath);
        return xpath;
    }
View Full Code Here

        {
            return new DOMXPath(expression);
        }
        else if (object instanceof org.dom4j.Document || object instanceof org.dom4j.Element)
        {
            return new Dom4jXPath(expression);
        }
//        else if (object instanceof nu.xom.Document)
//        {
//            return new XOMXPath(expression);
//        }
View Full Code Here

            if ( log.isDebugEnabled() ) {
                log.debug( "Parsing XPath expression: " + attributeValue );
            }
           
            try {
                XPath xpath = new Dom4jXPath(attributeValue);
                return new XPathExpression(xpath);
            }
            catch (JaxenException e) {
                throw new JellyException( "Could not parse XPath expression: \"" + attributeValue + "\" reason: " + e, e );           
            }           
View Full Code Here

            if ( log.isDebugEnabled() ) {
                log.debug( "Parsing XPath expression: " + attributeValue );
            }
           
            try {
                XPath xpath = new Dom4jXPath(attributeValue);
                return new XPathExpression(xpath);
            }
            catch (JaxenException e) {
                throw new JellyException( "Could not parse XPath expression: \"" + attributeValue + "\" reason: " + e, e );           
            }           
View Full Code Here

            if ( log.isDebugEnabled() ) {
                log.debug( "Parsing XPath expression: " + attributeValue );
            }
           
            try {
                XPath xpath = new Dom4jXPath(attributeValue);
                return new XPathExpression(xpath);
            }
            catch (JaxenException e) {
                throw new JellyException( "Could not parse XPath expression: \"" + attributeValue + "\" reason: " + e, e );           
            }           
View Full Code Here

  protected Element getObjectBeanElement( String objectId ) {
    try {
      String xPath = MessageFormat.format( BEAN_ID_XPATH, objectId );
      HashMap<String, String> map = new HashMap<String, String>();
      map.put( "default", DEFAULT_NAMESPACE ); //$NON-NLS-1$
      Dom4jXPath xpath = new Dom4jXPath( xPath );
      xpath.setNamespaceContext( new SimpleNamespaceContext( map ) );
      Element element = (Element) xpath.selectSingleNode( document );
      return element;
    } catch ( JaxenException jex ) {
      return null;
    }
  }
View Full Code Here

TOP

Related Classes of org.jaxen.dom4j.Dom4jXPath

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.