Android Utililty Methods XML String Build

List of utility methods to do XML String Build

Description

The list of methods to do XML String Build are organized into topic(s).

Method

StringaddCData(String xml)
add C Data
String cdataXml = "<![CDATA[";
cdataXml += xml;
cdataXml += "]]>";
return cdataXml;
voidaddElement(StringBuffer out, String tag)
Add an empty tag to the StringBuffer out.
out.append("<").append(tag).append("/>");
voidaddElement(StringBuffer out, String tag, String content)
Add a tag to the StringBuffer out.
out.append("<").append(tag).append(">").append(content)
        .append("</").append(tag).append(">");
StringcreateCloseTag(String tagname)
create Close Tag
return "</" + tagname + ">";
StringcreateCloseTagNewLine(String tagname)
create Close Tag New Line
return "</" + tagname + ">\n";
StringcreateOpenTag(String tagname)
create Open Tag
return "<" + tagname + ">";
StringcreateOpenTagNewLine(String tagname)
create Open Tag New Line
return "<" + tagname + ">\n";
StringgetXmlBetweenTag(String xml, String tag)
get Xml Between Tag
if (xml == null) {
    Log.e(TAG, "getXmlBetweenTag, params xml:" + xml + ", tag:"
            + tag);
    return "";
String ret = "";
String start = "<" + tag + ">";
String end = "</" + tag + ">";
...