/** * Open a tag; save on stack. * * @param tagName name of the tag * @return this */ public XMLBuffer openTag(String tagName) { tags.push(tagName); startTag(tagName); return this; }
/** * Add a complete tag with content. * * @param tagName name of the tag * @param content content to put in tag, or empty content, if an empty tag should be used * @return this */ public XMLBuffer tag(String tagName, CharSequence content) { if (content.length() == 0) { emptyTag(tagName); } else { startTag(tagName); sb.append(content); endTag(tagName); } return this; }