You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by tm...@apache.org on 2001/05/17 16:28:18 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler Output.java

tmiller     01/05/17 07:28:18

  Modified:    java/src/org/apache/xalan/xsltc/compiler Output.java
  Log:
  bug # 1406 fixed, omit xml header implemented
  
  Revision  Changes    Path
  1.3       +13 -3     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Output.java
  
  Index: Output.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Output.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Output.java	2001/05/02 10:24:57	1.2
  +++ Output.java	2001/05/17 14:28:13	1.3
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Output.java,v 1.2 2001/05/02 10:24:57 morten Exp $
  + * @(#)$Id: Output.java,v 1.3 2001/05/17 14:28:13 tmiller Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -112,7 +112,9 @@
        */
       private String generateXmlHeader() {
           // No header if user doesn't want one.
  -        if (_omitXmlDeclaration) return("");
  +        if (_omitXmlDeclaration)  {
  +	    return("");
  +	}
   
   	// Start off XML header
           final StringBuffer hdr = new StringBuffer("<?xml ");
  @@ -184,6 +186,15 @@
   	ConstantPoolGen cpg = classGen.getConstantPool();
   	InstructionList il = methodGen.getInstructionList();
   
  +	// bug fix # 1406, Compile code to set xml header on/off
  +	if ( _omitXmlDeclaration ) {
  +	    final int omitXmlDecl = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
  +						 "omitXmlDecl","(Z)V");
  +	    il.append(methodGen.loadHandler());
  +	    il.append(new PUSH(cpg, true));
  +	    il.append(new INVOKEINTERFACE(omitXmlDecl,2));
  +	}
  +
   	// Compile code to set the appropriate output type.
   	final int type = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
   						   "setType", "(I)V");
  @@ -223,7 +234,6 @@
   	    il.append(new PUSH(cpg, true));
   	    il.append(new INVOKEINTERFACE(indent,2));
   	}
  -
       }
   
       /**
  
  
  

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