ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r432871 - /ant/core/trunk/src/main/org/apache/tools/ant/util/DOMElementWriter.java
Date Sat, 19 Aug 2006 20:13:36 GMT
Author: bodewig
Date: Sat Aug 19 13:13:36 2006
New Revision: 432871

URL: http://svn.apache.org/viewvc?rev=432871&view=rev
Log:
make XML decl accessible

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/util/DOMElementWriter.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/DOMElementWriter.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/DOMElementWriter.java?rev=432871&r1=432870&r2=432871&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/DOMElementWriter.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/DOMElementWriter.java Sat Aug 19 13:13:36
2006
@@ -157,11 +157,19 @@
      */
     public void write(Element root, OutputStream out) throws IOException {
         Writer wri = new OutputStreamWriter(out, "UTF8");
-        if(xmlDeclaration) {
-            wri.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
-        }
+        writeXMLDeclaration(wri);
         write(root, wri, 0, "  ");
         wri.flush();
+    }
+
+    /**
+     * Writes the XML declaration.
+     * @since Ant 1.7.0
+     */
+    public void writeXMLDeclaration(Writer wri) throws IOException {
+        if (xmlDeclaration) {
+            wri.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+        }
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message