The XML classes in the com-hfg library are designed to let you construct or parse xml content in a modular, object-oriented way. The XMLTag class is the base tag for the HTML and SVG classes.
would produce the following XML snippet:
- XMLTag tag = new XMLTag("TagOne");
- tag.setAttribute("foo", "bar");
- tag.addContent("Hello World");
- tag.addSubtag(new XMLTag("TagTwo"));
- System.out.println(tag.toXML());
- <TagOne foo='bar'>Hello World<TagTwo /></TagOne>