Package nu.xom

Examples of nu.xom.Text


   

    public void testEmptyTextNodeNextToNonEmptyTextNode() {
       
        Element parent = new Element("Test");
        Text empty = new Text("");
        parent.appendChild(empty);
        Text nonempty = new Text("value");
        parent.appendChild(nonempty);
        Element child1 = new Element("child1");
        parent.appendChild(child1);
        Element child2 = new Element("child2");
        parent.appendChild(child2);
View Full Code Here


    }
   

    public void testSelfAxisWithUnparentedText() {
       
        Text text = new Text("test");
        Nodes result = text.query("self::text()");
        assertEquals(1, result.size());
        assertEquals(text, result.get(0))
       
    }
View Full Code Here

   

    public void testSelfAxisWithTextChild() {
       
        Element parent = new Element("parent");
        Node child = new Text("child");
        parent.appendChild(child);
        Nodes result = child.query("self::text()");
        assertEquals(1, result.size());
        assertEquals(child, result.get(0));
       
    }
View Full Code Here

   

    public void testSelfAxisWithTextChildren() {
       
        Element parent = new Element("parent");
        Node child1 = new Text("1");
        Node child2 = new Text("2");
        Node child3 = new Text("3");
        Node child4 = new Text("4");
        parent.appendChild(child1);
        parent.appendChild(child2);
        parent.appendChild(child3);
        parent.appendChild(child4);
        Nodes result = child1.query("self::text()");
View Full Code Here

   

    public void testSelfAxisWithTextChildren2() {
       
        Element parent = new Element("parent");
        Node child1 = new Text("1");
        Node child2 = new Text("2");
        Node child3 = new Text("3");
        Node child4 = new Text("4");
        parent.appendChild(child1);
        parent.appendChild(child2);
        parent.appendChild(child3);
        parent.appendChild(child4);
        Nodes result = child3.query("self::text()");
View Full Code Here

    }
   

    public void testSelfAxisWithTextChildAndNoParent() {
       
        Node child = new Text("child");
        Nodes result = child.query("self::text()");
        assertEquals(1, result.size());
        assertEquals(child, result.get(0));
       
    }
View Full Code Here

    }
   

    public void testAttributeAxisOnNonElement() {
       
        Text text = new Text("Test");
        Nodes result = text.query("attribute::*");
        assertEquals(0, result.size());
       
    }
View Full Code Here

       
        Element parent = new Element("Test");
        Element child1 = new Element("child1");
        Element child2 = new Element("child2");
        Element child3 = new Element("child3");
        Text text = new Text("test");
        child3.appendChild(text);
        Attribute id = new Attribute("a", "anchor");
        id.setType(Attribute.Type.ID);
        child2.addAttribute(id);
       
        parent.appendChild(child1);
        parent.appendChild(child2);
        parent.appendChild(child3);
       
        Nodes result = text.query("id('anchor')");
        assertEquals(1, result.size());    
        assertEquals(child2, result.get(0));
       
    }
View Full Code Here

    }
   

    public void testIDFunctionFromUnparentedTextNode() {
       
        Text text = new Text("test");
        Nodes result = text.query("id('anchor')");
        assertEquals(0, result.size());
       
    }
View Full Code Here

    }
   

    public void testIDFunctionFromDisconnectedTextNode() {
       
        Text text = new Text("test");      
        Nodes result = text.query("id('anchor')");
        assertEquals(0, result.size());
       
    }
View Full Code Here

TOP

Related Classes of nu.xom.Text

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.