mmidy 00/02/10 14:58:27
Modified: src/org/apache/xalan/xpath/xml FormatterToXML.java
Log:
Work around differences in default indent between Xalan and Xerces
Revision Changes Path
1.21 +6 -3
xml-xalan/src/org/apache/xalan/xpath/xml/FormatterToXML.java
Index: FormatterToXML.java
===================================================================
RCS file:
/home/cvs/xml-xalan/src/org/apache/xalan/xpath/xml/FormatterToXML.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- FormatterToXML.java 2000/02/09 21:09:01 1.20
+++ FormatterToXML.java 2000/02/10 22:58:27 1.21
@@ -381,9 +381,12 @@
public synchronized void init( Writer writer, OutputFormat format )
{
this.m_writer = writer;
- //this.m_doIndent = format.getIndenting();
- this.indent = format.getIndent();
- this.m_doIndent = ( indent >= 0 );
+ // This is to get around differences between Xalan and Xerces.
+ // Xalan uses -1 as default for no indenting, Xerces uses 0.
+ // So we just adjust the indent value here because we bumped it
+ // up previously ( in StylesheetRoot);
+ this.indent = format.getIndent() - 1;
+ this.m_doIndent = format.getIndenting();
this.m_shouldNotWriteXMLHeader = format.getOmitXMLDeclaration();
this.m_doctypeSystem = format.getDoctypeSystem();
this.m_doctypePublic = format.getDoctypePublic();