[sip-comm-cvs] CVS update: /sip-communicator/src/net/java/sip/communicator/util/xml/XMLUtils.java

emcho at dev.java.net emcho at dev.java.net
Fri May 18 19:17:27 CEST 2007


User: emcho   
Date: 2007-05-18 17:17:27+0000
Log:
 replacing DOMElementWriter with built-in java XML tools

File Changes:

Directory: /sip-communicator/src/net/java/sip/communicator/util/xml/
====================================================================

File [changed]: XMLUtils.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/util/xml/XMLUtils.java?r1=1.10&r2=1.11
Delta lines:  +18 -13
---------------------
--- XMLUtils.java	2007-04-23 13:07:26+0000	1.10
+++ XMLUtils.java	2007-05-18 17:17:24+0000	1.11
@@ -192,13 +192,13 @@
     public static void writeXML(Document document, File out)
         throws java.io.IOException
     {
-        indentedWriteXML(document, new FileOutputStream(out));
-//        writeXML(document
-//                 , new StreamResult(
-//                        new OutputStreamWriter(
-//                                new FileOutputStream(out), "UTF-8"))
-//                 , null
-//                 , null);
+//        indentedWriteXML(document, new FileOutputStream(out));
+        writeXML(document
+                 , new StreamResult(
+                        new OutputStreamWriter(
+                                new FileOutputStream(out), "UTF-8"))
+                 , null
+                 , null);
     }
 
     /**
@@ -274,16 +274,21 @@
      */
     public static void indentedWriteXML(Document doc, OutputStream out)
     {
-        Element rootElement = doc.getDocumentElement();
         if (out != null)
         {
             try
             {
-                Writer wri = new OutputStreamWriter(out, "UTF-8");
-                wri.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"+lSep);
-                (new DOMElementWriter()).write(rootElement, wri, 0, "  ");
-                wri.flush();
-                wri.close();
+//                Writer wri = new OutputStreamWriter(out, "UTF-8");
+//                wri.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"+lSep);
+//                (new DOMElementWriter()).write(rootElement, wri, 0, "  ");
+//                wri.flush();
+//                wri.close();
+                writeXML(doc
+                 , new StreamResult(
+                        out)
+                 , null
+                 , null);
+                out.close();
             }
             catch (IOException exc)
             {




---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe at sip-communicator.dev.java.net
For additional commands, e-mail: cvs-help at sip-communicator.dev.java.net





More information about the commits mailing list