All pastes #366432 Raw Edit

Mine

public text v1 · immutable
#366432 ·published 2007-02-21 17:54 UTC
rendered paste body
public class Test {
  public static void main(String[] args) {
    XmlBuffer buf = new XmlBuffer();

    try {
      buf
        .openTag("ItemDiscountAddRq")
          .openTag("ItemDiscountAdd").addAttribute("foo", "b&ar").addAttribute("biz", "bam")
            .textTag("Name", "Foobar")
          .closeTag()
          .openTag("ItemDiscountDel")
            .textTag("Foo", "barfoo")
          .closeTag()
        .closeTag();


      System.out.print(buf.toString());
    } catch (XmlBuffer.InvalidOpException e) {
      System.out.println("Error: " + e.getMessage());
    }
  }
}