Permalink
Browse files

new example

  • Loading branch information...
1 parent 5c42c04 commit bf45fbae8646ca8a7e7eb19c44d8289d534b4604 @mschrag committed Nov 24, 2009
Showing with 28 additions and 0 deletions.
  1. +28 −0 example/org/xiss/example/Building2.java
@@ -0,0 +1,28 @@
+package org.xiss.example;
+
+import org.xiss.XML;
+
+public class Building2 {
+ public static void main(String[] args) {
+ XML.Doc doc = XML.doc();
+ doc.comment("This is the structure for a person");
+ XML.E person = doc.root("person");
+ {
+ person.e("first-name", "Bob");
+ person.e("last-name").setText("Jones");
+ person.comment("This is the structure for addresses");
+ XML.E addresses = person.e("addresses");
+ {
+ XML.E homeAddress = addresses.e("address").set("location", "Home");
+ {
+ homeAddress.e("address", "100 Main St");
+ homeAddress.e("city", "Richmond");
+ homeAddress.e("state", "VA");
+ homeAddress.e("zip", "23233");
+ }
+ addresses.cdata("This is a cdata section! <test> of cdata!");
+ }
+ }
+ System.out.println(doc);
+ }
+}

0 comments on commit bf45fba

Please sign in to comment.