Package org.w3c.dom.traversal

Examples of org.w3c.dom.traversal.TreeWalker.nextNode()


        assertEquals("c", tw.nextNode().getLocalName());
        assertEquals("d", tw.nextNode().getLocalName());
        assertEquals("e", tw.nextNode().getLocalName());
        assertEquals("f", tw.nextNode().getLocalName());
        assertEquals("g", tw.nextNode().getLocalName());
        assertEquals("h", tw.nextNode().getLocalName());
        assertEquals("i", tw.nextNode().getLocalName());
        assertEquals(null, tw.nextNode());
    }

    public void testPreviousNode() throws Exception {
View Full Code Here


        assertEquals("d", tw.nextNode().getLocalName());
        assertEquals("e", tw.nextNode().getLocalName());
        assertEquals("f", tw.nextNode().getLocalName());
        assertEquals("g", tw.nextNode().getLocalName());
        assertEquals("h", tw.nextNode().getLocalName());
        assertEquals("i", tw.nextNode().getLocalName());
        assertEquals(null, tw.nextNode());
    }

    public void testPreviousNode() throws Exception {
        TreeWalker tw = new TreeWalkerImpl(dom, NodeFilter.SHOW_ALL, null, false);
View Full Code Here

        assertEquals("e", tw.nextNode().getLocalName());
        assertEquals("f", tw.nextNode().getLocalName());
        assertEquals("g", tw.nextNode().getLocalName());
        assertEquals("h", tw.nextNode().getLocalName());
        assertEquals("i", tw.nextNode().getLocalName());
        assertEquals(null, tw.nextNode());
    }

    public void testPreviousNode() throws Exception {
        TreeWalker tw = new TreeWalkerImpl(dom, NodeFilter.SHOW_ALL, null, false);
        tw.setCurrentNode(dom.getLastChild());
View Full Code Here

        assertEquals(null, tw.previousNode());
        assertEquals("a", tw.getCurrentNode().getLocalName());

        tw.setCurrentNode(dom.getLastChild());
        assertEquals("i", tw.getCurrentNode().getLocalName());
        assertEquals(null, tw.nextNode());
        assertEquals("i", tw.getCurrentNode().getLocalName());

        try {
            tw.setCurrentNode(null);
            fail("Exception expected");
View Full Code Here

    }

    public void testParentNode() throws Exception {
        TreeWalker tw = new TreeWalkerImpl(dom, NodeFilter.SHOW_ALL, null, false);
        // Go to F node
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        assertEquals("f", tw.getCurrentNode().getLocalName());
View Full Code Here

    public void testParentNode() throws Exception {
        TreeWalker tw = new TreeWalkerImpl(dom, NodeFilter.SHOW_ALL, null, false);
        // Go to F node
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        assertEquals("f", tw.getCurrentNode().getLocalName());
View Full Code Here

    public void testParentNode() throws Exception {
        TreeWalker tw = new TreeWalkerImpl(dom, NodeFilter.SHOW_ALL, null, false);
        // Go to F node
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        assertEquals("f", tw.getCurrentNode().getLocalName());

        assertEquals("d", tw.parentNode().getLocalName());
View Full Code Here

        TreeWalker tw = new TreeWalkerImpl(dom, NodeFilter.SHOW_ALL, null, false);
        // Go to F node
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        assertEquals("f", tw.getCurrentNode().getLocalName());

        assertEquals("d", tw.parentNode().getLocalName());
        assertEquals("c", tw.parentNode().getLocalName());
View Full Code Here

        // Go to F node
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        tw.nextNode();
        assertEquals("f", tw.getCurrentNode().getLocalName());

        assertEquals("d", tw.parentNode().getLocalName());
        assertEquals("c", tw.parentNode().getLocalName());
        assertEquals("a", tw.parentNode().getLocalName());
View Full Code Here

                return FILTER_ACCEPT;
            }
        }, false);

        // To populate accepted we only need to walk the tree.
      while (treeWalker.nextNode() != null);

        final List<ItemProp> result = new ArrayList<ItemProp>();
        for(Node itemPropNode :  accepted) {
            final String itemProp = DomUtils.readAttribute(itemPropNode, ITEMPROP_ATTRIBUTE, null);
            final String[] propertyNames = itemProp.split(" ");
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.