Package com.ociweb.xml

Examples of com.ociweb.xml.WAX.start()


        // There are also WAX constructors that take
        // a java.io.OutputStream and a java.io.Writer object.
        WAX wax = new WAX();

        out("Only a root element:");
        wax.start("car").close();
        // <car/>

        // After a WAX object is closed,
        // a new one must be created to write more XML.
        wax = new WAX();
View Full Code Here


        // After a WAX object is closed,
        // a new one must be created to write more XML.
        wax = new WAX();

        out("A root element with some text inside:");
        wax.start("car").text("Prius").close();
        // <car>Prius</car>

        out("Text inside a child element:");
        wax = new WAX();
        wax.start("car").start("model").text("Prius").close();
View Full Code Here

        wax.start("car").text("Prius").close();
        // <car>Prius</car>

        out("Text inside a child element:");
        wax = new WAX();
        wax.start("car").start("model").text("Prius").close();
        // <car>
        //   <model>Prius</model>
        // </car>

        out("The same with the \"child\" convenience method:");
View Full Code Here

        //   <model>Prius</model>
        // </car>

        out("The same with the \"child\" convenience method:");
        wax = new WAX();
        wax.start("car").child("model", "Prius").close();
        // <car>
        //   <model>Prius</model>
        // </car>

        out("Text in a CDATA section:");
View Full Code Here

        //   <model>Prius</model>
        // </car>

        out("Text in a CDATA section:");
        wax = new WAX();
        wax.start("car").start("model").cdata("1<2>3&4'5\"6").close();
        // <car>
        //   <model>
        //     <![CDATA[1<2>3&4'5\"6]]>
        //   </model>
        // </car>
View Full Code Here

        // </car>

        out("Without indentation, on a single line:");
        wax = new WAX();
        wax.noIndentsOrLineSeparators();
        wax.start("car").child("model", "Prius").close();
        // <car><model>Prius</model></car>

        out("Indent with four spaces instead of the default of two:");
        wax = new WAX();
        wax.setIndent("    ");
View Full Code Here

        // <car><model>Prius</model></car>

        out("Indent with four spaces instead of the default of two:");
        wax = new WAX();
        wax.setIndent("    ");
        wax.start("car").child("model", "Prius").close();
        // <car>
        //     <model>Prius</model>
        // </car>

        out("Add an attribute:");
View Full Code Here

        //     <model>Prius</model>
        // </car>

        out("Add an attribute:");
        wax = new WAX();
        wax.start("car").attr("year", 2008).child("model", "Prius").close();
        // <car year="2008">
        //   <model>Prius</model>
        // </car>

        out("XML declaration:");
View Full Code Here

        //   <model>Prius</model>
        // </car>

        out("XML declaration:");
        wax = new WAX(Version.V1_0);
        wax.start("car").attr("year", 2008)
           .child("model", "Prius").close();
        // <?xml version="1.0" encoding="UTF-8"?>
        // <car year="2008">
        //   <model>Prius</model>
        // </car>
View Full Code Here

        //   <model>Prius</model>
        // </car>

        out("Associate a default namespace:");
        wax = new WAX();
        wax.start("car").attr("year", 2008)
           .defaultNamespace("http://www.ociweb.com/cars")
           .child("model", "Prius").close();
        // <car year="2008"
        //   xmlns="http://www.ociweb.com/cars">
        //   <model>Prius</model>
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.