You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sa...@apache.org on 2002/06/19 22:36:05 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output StreamHTMLOutput.java StreamUnknownOutput.java

santiagopg    2002/06/19 13:36:05

  Modified:    java/src/org/apache/xalan/xsltc/runtime
                        AbstractTranslet.java
               java/src/org/apache/xalan/xsltc/runtime/output
                        StreamHTMLOutput.java StreamUnknownOutput.java
  Log:
  Fixed indentation when output method is HTML.
  
  Revision  Changes    Path
  1.40      +7 -3      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
  
  Index: AbstractTranslet.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- AbstractTranslet.java	12 Jun 2002 20:08:56 -0000	1.39
  +++ AbstractTranslet.java	19 Jun 2002 20:36:05 -0000	1.40
  @@ -575,13 +575,17 @@
   		if (_version != null) {
   		    handler.setVersion(_version);
   		}
  -		handler.setIndent(_indent);
  +		if (_indent) {
  +		    handler.setIndent(_indent);
  +		}
   		if (_doctypeSystem != null) {
   		    handler.setDoctype(_doctypeSystem, _doctypePublic);
   		}
   	    }
   	    else if (_method.equals("html")) {
  -		handler.setIndent(_indent);
  +		if (!_indent) {
  +		    handler.setIndent(_indent);
  +		}
   		handler.setDoctype(_doctypeSystem, _doctypePublic);
   		if (_mediaType != null) {
   		    handler.setMediaType(_mediaType);
  
  
  
  1.13      +2 -1      xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamHTMLOutput.java
  
  Index: StreamHTMLOutput.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamHTMLOutput.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- StreamHTMLOutput.java	19 Jun 2002 19:24:49 -0000	1.12
  +++ StreamHTMLOutput.java	19 Jun 2002 20:36:05 -0000	1.13
  @@ -97,6 +97,7 @@
   
       public StreamHTMLOutput(StreamOutput output) {
   	super(output);
  +	setIndent(true);  // default for HTML
   // System.out.println("StreamHTMLOutput.<init>");
       }
   
  
  
  
  1.6       +5 -10     xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamUnknownOutput.java
  
  Index: StreamUnknownOutput.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamUnknownOutput.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- StreamUnknownOutput.java	19 Jun 2002 19:24:49 -0000	1.5
  +++ StreamUnknownOutput.java	19 Jun 2002 20:36:05 -0000	1.6
  @@ -90,7 +90,6 @@
       // Cache calls to output properties events
       private String       _mediaType          = null;
       private boolean      _callStartDocument  = false;
  -    private boolean      _callSetIndent      = false;
       private boolean      _callSetVersion     = false;
       private boolean      _callSetDoctype     = false;
   
  @@ -247,12 +246,12 @@
   	_callSetDoctype = true;
       }
   
  +    /**
  +     * This method cannot be cached because default is different in 
  +     * HTML and XML (we need more than a boolean).
  +     */
       public void setIndent(boolean indent) { 
   	_handler.setIndent(indent);
  -
  -	// Cache call to setIndent()
  -	super.setIndent(indent);
  -	_callSetIndent = true;
       }
   
       public void setVersion(String version) { 
  @@ -294,10 +293,6 @@
   	if (_isHtmlOutput) {
   	    _handler = new StreamHTMLOutput(_handler);
   
  -	    // Transfer output properties (HTML only)
  -	    if (_callSetIndent) {
  -		_handler.setIndent(_indent);
  -	    }
   	    if (_callSetVersion) {
   		_handler.setVersion(_version);
   	    }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org