Package nu.xom

Examples of nu.xom.Text.toXML()


        Text t = new Text("name");
       
        // Things that shouldn't cause an exception
        for (int i = 0; i < easyCases.length; i++) {
            t.setValue(easyCases[i]);  
            assertEquals(easyCases[i], t.toXML());
        }
       
        t.setValue("<>");
        assertEquals("&lt;&gt;", t.toXML());
        t.setValue("&amp;");
View Full Code Here


            t.setValue(easyCases[i]);  
            assertEquals(easyCases[i], t.toXML());
        }
       
        t.setValue("<>");
        assertEquals("&lt;&gt;", t.toXML());
        t.setValue("&amp;");
        assertEquals("&amp;amp;", t.toXML());
        t.setValue("]]>");
        assertEquals("]]&gt;", t.toXML());
        t.setValue("\r");
View Full Code Here

        }
       
        t.setValue("<>");
        assertEquals("&lt;&gt;", t.toXML());
        t.setValue("&amp;");
        assertEquals("&amp;amp;", t.toXML());
        t.setValue("]]>");
        assertEquals("]]&gt;", t.toXML());
        t.setValue("\r");
        assertEquals("&#x0D;", t.toXML());
       
View Full Code Here

        t.setValue("<>");
        assertEquals("&lt;&gt;", t.toXML());
        t.setValue("&amp;");
        assertEquals("&amp;amp;", t.toXML());
        t.setValue("]]>");
        assertEquals("]]&gt;", t.toXML());
        t.setValue("\r");
        assertEquals("&#x0D;", t.toXML());
       
    }
View Full Code Here

        t.setValue("&amp;");
        assertEquals("&amp;amp;", t.toXML());
        t.setValue("]]>");
        assertEquals("]]&gt;", t.toXML());
        t.setValue("\r");
        assertEquals("&#x0D;", t.toXML());
       
    }

   
    public void testPunctuationCharactersInToXML() {
View Full Code Here

   
    public void testPunctuationCharactersInToXML() {
       
        String data = "=,.!@#$%^*()_-\"'[]{}+/?;:`|\\";
        Text t = new Text(data);
        assertEquals(data, t.toXML());
       
    }

   
    public void testEquals() {
View Full Code Here

   
    // Make sure carriage returns are escaped properly by toXML()
    public void testCarriageReturnInText() {
        Text text = new Text("data\rdata");
        String xml = text.toXML();
        assertEquals("data&#x0D;data", xml);  
    }
   
   
    public void testHighSurrogateWithNoLowSurrogate() {
View Full Code Here

        Text t = new Text("name");
       
        // Things that shouldn't cause an exception
        for (int i = 0; i < easyCases.length; i++) {
            t.setValue(easyCases[i]);  
            assertEquals(easyCases[i], t.toXML());
        }
       
        t.setValue("<>");
        assertEquals("&lt;&gt;", t.toXML());
        t.setValue("&amp;");
View Full Code Here

            t.setValue(easyCases[i]);  
            assertEquals(easyCases[i], t.toXML());
        }
       
        t.setValue("<>");
        assertEquals("&lt;&gt;", t.toXML());
        t.setValue("&amp;");
        assertEquals("&amp;amp;", t.toXML());
        t.setValue("]]>");
        assertEquals("]]&gt;", t.toXML());
        t.setValue("\r");
View Full Code Here

        }
       
        t.setValue("<>");
        assertEquals("&lt;&gt;", t.toXML());
        t.setValue("&amp;");
        assertEquals("&amp;amp;", t.toXML());
        t.setValue("]]>");
        assertEquals("]]&gt;", t.toXML());
        t.setValue("\r");
        assertEquals("&#x0D;", t.toXML());
       
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.