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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]