append XML Header to String - Android XML

Android examples for XML:XML String

Description

append XML Header to String

Demo Code

/*L/* www  .  ja v  a 2 s.co  m*/
 * Copyright SAIC, SAIC-Frederick.
 *
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.com/caadapter/LICENSE.txt for details.
 */

public class Main{
    private StringBuffer xmlString;
    private static String xmlVersion = "1.0";
    private static String encoding = "UTF-8";
    /**
     * @param xmlHelper
     */
    public static void appendHeader(XMLHelper xmlHelper) {
        xmlHelper.append("<?xml version=\"" + xmlVersion + "\" encoding=\""
                + encoding + "\" ?>");
    }
    public void append(String s) {
        xmlString.append(s);
    }
}

Related Tutorials