Package nu.xom

Examples of nu.xom.Text


           
            NodeFactory factory = builder.getNodeFactory();
            if (factory != null) {
                return factory.makeText(sb.toString());
            }
            else return new Nodes(new Text(sb.toString()));
        }
        finally {
            in.close();  
        }
     
View Full Code Here


    public Nodes makeComment(String data) {
        return new Nodes(new Comment(rot13(data)));
    }   

    public Nodes makeText(String data) {
        return new Nodes(new Text(rot13(data)))
    }   
View Full Code Here

       
    }
  
   
    public void testParentlessNodesHaveEmptyBaseURIs() {
        Text t = new Text("data");  
        assertEquals("", t.getBaseURI());
       
        Element e = new Element("a");
        assertEquals("", e.getBaseURI());
    }
View Full Code Here

    public void testEmptyTextNodesDontCount() {
       
        Element parent = new Element("Test");
        Element child1 = new Element("child1");
        parent.appendChild(child1);
        parent.appendChild(new Text(""));
        parent.appendChild(new Text(""));
        Element child2 = new Element("child2");
        parent.appendChild(child2);
       
        Nodes result = parent.query("*");
        assertEquals(2, result.size());
View Full Code Here

   

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

        Element parent = new Element("Test");
        Element child1 = new Element("child1");
        parent.appendChild(child1);
        Element child2 = new Element("child2");
        parent.appendChild(child2);
        parent.appendChild(new Text(""));
        parent.appendChild(new Text(""));
        parent.appendChild(new Text(""));
       
        Nodes result = parent.query("node()");
        assertEquals(2, result.size());
        assertEquals(child1, result.get(0));  
        assertEquals(child2, result.get(1));  
View Full Code Here

   

    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

       

    protected void setUp() {
       
        child1 = new Element("test");
        child2 = new Text("test2");
        child3 = new Comment("test3");
        child4 = new Element("pre:test", "http://www.example.com");
        child5 = new Element("test", "http://www.example.com");
        element = new Element("name");
       
View Full Code Here

        String uri = "http://www.red.com/";
        Element e = new Element(name, uri);

        assertEquals(e.getValue(), "");
       
        e.appendChild(new Text("data"));
        assertEquals(e.getValue(), "data");
        e.appendChild(new Text(" moredata"));
        assertEquals(e.getValue(), "data moredata");
        e.appendChild(new Comment(" moredata"));
        assertEquals(e.getValue(), "data moredata");
        e.appendChild(
          new ProcessingInstruction("target", "moredata"));
        assertEquals(e.getValue(), "data moredata");
       
        Element e2 = new Element("child");
        e.appendChild(e2);
        assertEquals("data moredata", e.getValue());
        e2.appendChild(new Text("something"));
        assertEquals("data moredatasomething", e.getValue());
       
    }
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.