You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2006/08/19 22:13:36 UTC

svn commit: r432871 - /ant/core/trunk/src/main/org/apache/tools/ant/util/DOMElementWriter.java

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