src/com/sun/org/apache/xml/internal/serializer/ToStream.java

Print this page

        

*** 2391,2406 **** m_needToCallStartDocument = false; } try { final int limit = start + length; boolean wasDash = false; if (m_cdataTagOpen) closeCDATA(); ! if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; writer.write(COMMENT_BEGIN); // Detect occurrences of two consecutive dashes, handle as necessary. --- 2391,2409 ---- m_needToCallStartDocument = false; } try { + if (shouldIndent() && m_isStandalone) + indent(); + final int limit = start + length; boolean wasDash = false; if (m_cdataTagOpen) closeCDATA(); ! if (shouldIndent() && !m_isStandalone) indent(); final java.io.Writer writer = m_writer; writer.write(COMMENT_BEGIN); // Detect occurrences of two consecutive dashes, handle as necessary.
*** 2688,2698 **** * * @return True if an indent should occur. */ protected boolean shouldIndent() { ! return m_doIndent && (!m_ispreserve && !m_isprevtext) && m_elemContext.m_currentElemDepth > 0; } /** * Searches for the list of qname properties with the specified key in the * property list. If the key is not found in this property list, the default --- 2691,2701 ---- * * @return True if an indent should occur. */ protected boolean shouldIndent() { ! return m_doIndent && (!m_ispreserve && !m_isprevtext) && (m_elemContext.m_currentElemDepth > 0 || m_isStandalone); } /** * Searches for the list of qname properties with the specified key in the * property list. If the key is not found in this property list, the default