String version = getVersion(); if (version == null) version = "1.0";
    public void startDocumentInternal() throws org.xml.sax.SAXException    {        if (m_needToCallStartDocument)        {             super.startDocumentInternal();            m_needToCallStartDocument = false;            if (m_inEntityRef)                return;            m_needToOutputDocTypeDecl = true;            m_startNewLine = false;            if (getOmitXMLDeclaration() == false)            {                String encoding = Encodings.getMimeEncoding(getEncoding());                String version = getVersion();                if (version == null)                    version = "1.0";                String standalone;                if (m_standaloneWasSpecified)                {                    standalone = " standalone=\"" + getStandalone() + "\"";                }                else                {                    standalone = "";                }                try                {                    final java.io.Writer writer = m_writer;                    writer.write("<?xml version=\"");                    writer.write(version);                    writer.write("\" encoding=\"");                    writer.write(encoding);                    writer.write('\"');                    writer.write(standalone);                    writer.write("?>");                    if (m_doIndent)                        writer.write(m_lineSep, 0, m_lineSepLen);                }                 catch(IOException e)                {                    throw new SAXException(e);                }            }        }    }