Package org.dom4j

Examples of org.dom4j.Node.selectSingleNode()


        if (failed > 0) {
            logger.debug("Failed to add " + failed + " Jobs:");
            final List nodes = result.selectNodes("/result/failed/job");
            for (final Object node2 : nodes) {
                final Node node1 = (Node) node2;
                final String error = null != node1.selectSingleNode("error") ? node1.selectSingleNode("error")
                    .getStringValue() : "Failed";
                final IStoredJobLoadResult storedJobLoadResult = parseAPIJobResult(node1, false, false,
                    error);

                resultList.add(storedJobLoadResult);
View Full Code Here


            logger.debug("Skipped " + skipped + " Jobs:");
            final List nodes = result.selectNodes("/result/skipped/job");
            for (final Object node2 : nodes) {
                final Node node1 = (Node) node2;

                final String error = null != node1.selectSingleNode("error") ? node1.selectSingleNode("error")
                    .getStringValue() : "Skipped";
                final IStoredJobLoadResult storedJobLoadResult = parseAPIJobResult(node1, true, true,
                    error);
                resultList.add(storedJobLoadResult);
View Full Code Here

            logger.debug("Skipped " + skipped + " Jobs:");
            final List nodes = result.selectNodes("/result/skipped/job");
            for (final Object node2 : nodes) {
                final Node node1 = (Node) node2;

                final String error = null != node1.selectSingleNode("error") ? node1.selectSingleNode("error")
                    .getStringValue() : "Skipped";
                final IStoredJobLoadResult storedJobLoadResult = parseAPIJobResult(node1, true, true,
                    error);
                resultList.add(storedJobLoadResult);
View Full Code Here

        assertNotNull( root.selectSingleNode("node/attribute"));
        List list = root.selectNodes("node/attribute");
        assertEquals(2, list.size());

        Node attr1 = (Node) list.get(0);
        assertEquals("another:attribute", attr1.selectSingleNode("@name").getStringValue());
        assertEquals("test value", attr1.selectSingleNode("@value").getStringValue());

        Node attr2 = (Node)list.get(1);
        assertEquals("my:attr", attr2.selectSingleNode("@name").getStringValue());
        assertEquals("myattrvalue", attr2.selectSingleNode("@value").getStringValue());
View Full Code Here

        List list = root.selectNodes("node/attribute");
        assertEquals(2, list.size());

        Node attr1 = (Node) list.get(0);
        assertEquals("another:attribute", attr1.selectSingleNode("@name").getStringValue());
        assertEquals("test value", attr1.selectSingleNode("@value").getStringValue());

        Node attr2 = (Node)list.get(1);
        assertEquals("my:attr", attr2.selectSingleNode("@name").getStringValue());
        assertEquals("myattrvalue", attr2.selectSingleNode("@value").getStringValue());
    }
View Full Code Here

        Node attr1 = (Node) list.get(0);
        assertEquals("another:attribute", attr1.selectSingleNode("@name").getStringValue());
        assertEquals("test value", attr1.selectSingleNode("@value").getStringValue());

        Node attr2 = (Node)list.get(1);
        assertEquals("my:attr", attr2.selectSingleNode("@name").getStringValue());
        assertEquals("myattrvalue", attr2.selectSingleNode("@value").getStringValue());
    }

    /**
     * Attributes with a "." are generated in separate <attribute .. /> elements
View Full Code Here

        assertEquals("another:attribute", attr1.selectSingleNode("@name").getStringValue());
        assertEquals("test value", attr1.selectSingleNode("@value").getStringValue());

        Node attr2 = (Node)list.get(1);
        assertEquals("my:attr", attr2.selectSingleNode("@name").getStringValue());
        assertEquals("myattrvalue", attr2.selectSingleNode("@value").getStringValue());
    }

    /**
     * Attributes with a "." are generated in separate <attribute .. /> elements
     * @throws Exception
View Full Code Here

        List list = root.selectNodes("node/attribute");
        assertEquals(2, list.size());

        for (Object o : list) {
            Node attr1 = (Node) list.get(0);
            String name = attr1.selectSingleNode("@name").getStringValue();
            if("another.attribute".equals(name)){
                assertEquals("another.attribute", name);
                assertEquals("test value", attr1.selectSingleNode("@value").getStringValue());
            }else{
                assertEquals("my.attr", name);
View Full Code Here

        for (Object o : list) {
            Node attr1 = (Node) list.get(0);
            String name = attr1.selectSingleNode("@name").getStringValue();
            if("another.attribute".equals(name)){
                assertEquals("another.attribute", name);
                assertEquals("test value", attr1.selectSingleNode("@value").getStringValue());
            }else{
                assertEquals("my.attr", name);
                assertEquals("myattrvalue", attr1.selectSingleNode("@value").getStringValue());
            }
        }
View Full Code Here

            if("another.attribute".equals(name)){
                assertEquals("another.attribute", name);
                assertEquals("test value", attr1.selectSingleNode("@value").getStringValue());
            }else{
                assertEquals("my.attr", name);
                assertEquals("myattrvalue", attr1.selectSingleNode("@value").getStringValue());
            }
        }


    }
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.