santiagopg    02/05/23 13:59:38

  Modified:    java/src/org/apache/xalan/xsltc/runtime/output
                        StreamXMLOutput.java
  Log:
  Insert XML header at the beginning.
  
  Revision  Changes    Path
  1.5       +11 -5     
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamXMLOutput.java
  
  Index: StreamXMLOutput.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamXMLOutput.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StreamXMLOutput.java      23 May 2002 18:13:04 -0000      1.4
  +++ StreamXMLOutput.java      23 May 2002 20:59:38 -0000      1.5
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: StreamXMLOutput.java,v 1.4 2002/05/23 18:13:04 santiagopg Exp $
  + * @(#)$Id: StreamXMLOutput.java,v 1.5 2002/05/23 20:59:38 santiagopg Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -185,17 +185,22 @@
       }
   
       public void startDocument() throws TransletException { 
  +// System.out.println("startDocument");
        if (!_omitHeader) {
  -         _buffer.append("<?xml version=\"").append(_version)
  -                .append("\" encoding=\"").append(_encoding);
  +         final StringBuffer header = new StringBuffer("<?xml version=\"");
  +         header.append(_version).append("\" encoding=\"").append(_encoding);
            if (_standalone != null) {
  -             _buffer.append("\" standalone=\"").append(_standalone);
  +             header.append("\" standalone=\"").append(_standalone);
            }
  -         _buffer.append("\"?>\n");
  +         header.append("\"?>\n");
  +
  +         // Always insert header at the beginning 
  +         _buffer.insert(0, header.toString());
        }
       }
   
       public void endDocument() throws TransletException { 
  +// System.out.println("endDocument");
        if (_startTagOpen) {
            _buffer.append("/>");
        }
  @@ -272,6 +277,7 @@
       }
   
       public void characters(String characters) throws TransletException { 
  +// System.out.println("characters() '" + characters + "'");
        if (_startTagOpen) {
            _buffer.append('>');
            _startTagOpen = false;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to