Package org.dom4j

Examples of org.dom4j.XPath.selectSingleNode()


    public Element getElement( String xpathExpr )
        throws XMLException
    {
        XPath xpath = createXPath( xpathExpr );
        Object evaluated = xpath.selectSingleNode( document );

        if ( evaluated == null )
        {
            return null;
        }
View Full Code Here


    public boolean hasElement( String xpathExpr )
        throws XMLException
    {
        XPath xpath = createXPath( xpathExpr );
        Object evaluated = xpath.selectSingleNode( document );

        if ( evaluated == null )
        {
            return false;
        }
View Full Code Here

    public String getElementText( Node context, String xpathExpr )
        throws XMLException
    {
        XPath xpath = createXPath( xpathExpr );
        Object evaluated = xpath.selectSingleNode( context );

        if ( evaluated == null )
        {
            return null;
        }
View Full Code Here

    public String getElementText( String xpathExpr )
        throws XMLException
    {
        XPath xpath = createXPath( xpathExpr );
        Object evaluated = xpath.selectSingleNode( document );

        if ( evaluated == null )
        {
            return null;
        }
View Full Code Here

    }

    public Node selectSingleNode(String xpathExpression) {
        XPath xpath = createXPath(xpathExpression);

        return xpath.selectSingleNode(this);
    }

    public String valueOf(String xpathExpression) {
        XPath xpath = createXPath(xpathExpression);
View Full Code Here

    public static void xpath(Document document, String xpathExp, int kk) {

        long start = System.currentTimeMillis();
        XPath xpath = document.createXPath(xpathExp);
        for (int ii = 0; ii < kk; ii++) {
            Node node = xpath.selectSingleNode(document);

            if ((node != null) & (ii == 0)) {
                String val = node.getStringValue();
                // System.out.println(val);
            }
View Full Code Here

    public static void xpath(Document document, String xpathExp, int kk) {

        long start = System.currentTimeMillis();
        XPath xpath = document.createXPath(xpathExp);
        for (int ii = 0; ii < kk; ii++) {
            Node node = xpath.selectSingleNode(document);

            if ((node != null) & (ii == 0)) {
                String val = node.getStringValue();
                // System.out.println("xpath OK:"+val);
            }
View Full Code Here

    }

    public Node selectSingleNode(String xpathExpression) {
        XPath xpath = createXPath(xpathExpression);

        return xpath.selectSingleNode(this);
    }

    public String valueOf(String xpathExpression) {
        XPath xpath = createXPath(xpathExpression);
View Full Code Here

/*     */   }
/*     */
/*     */   public Node selectSingleNode(String xpathExpression) {
/* 183 */     XPath xpath = createXPath(xpathExpression);
/*     */
/* 185 */     return xpath.selectSingleNode(this);
/*     */   }
/*     */
/*     */   public String valueOf(String xpathExpression) {
/* 189 */     XPath xpath = createXPath(xpathExpression);
/*     */
View Full Code Here

        log.debug("Extracting profile ID");

        XPath xpath = DocumentHelper.createXPath("/t2f:workflow/t2f:dataflow[@role='top']/@id");

        xpath.setNamespaceURIs(T2FLOW_NAMESPACE_MAP);
        Node node = xpath.selectSingleNode(doc);
        if (node == null) {
            return null;
        }
        return node.getText();
    }
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.