]> source.dussan.org Git - poi.git/commitdiff
removed deprecated code to keep javac happy
authorYegor Kozlov <yegor@apache.org>
Fri, 17 Apr 2009 17:59:01 +0000 (17:59 +0000)
committerYegor Kozlov <yegor@apache.org>
Fri, 17 Apr 2009 17:59:01 +0000 (17:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@766102 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xssf/dev/XSSFDump.java

index 3bb60e90342870343d951eea38fe22b7fee60ffd..30a800e5314a5b8c7739fdf2cf708755a0097521 100755 (executable)
@@ -16,8 +16,8 @@
 ==================================================================== */\r
 package org.apache.poi.xssf.dev;\r
 \r
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;\r
-import org.w3c.dom.Document;\r
+import org.apache.xmlbeans.XmlObject;\r
+import org.apache.xmlbeans.XmlOptions;\r
 \r
 import javax.xml.parsers.DocumentBuilderFactory;\r
 import javax.xml.parsers.DocumentBuilder;\r
@@ -26,9 +26,6 @@ import java.util.zip.ZipFile;
 import java.util.zip.ZipEntry;\r
 import java.util.Enumeration;\r
 \r
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;\r
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;\r
-\r
 /**\r
  * Utility class which dumps the contents of a *.xlsx file into file system.\r
  *\r
@@ -68,15 +65,10 @@ public class XSSFDump {
 \r
             if(entry.getName().endsWith(".xml") || entry.getName().endsWith(".vml") || entry.getName().endsWith(".rels")){\r
                 try {\r
-                    //pass the xml through the Xerces serializer to produce nicely formatted output\r
-                    Document doc = builder.parse(zip.getInputStream(entry));\r
-\r
-                    OutputFormat  format  = new OutputFormat( doc );\r
-                    format.setIndenting(true);\r
-\r
-                    XMLSerializer serial = new  XMLSerializer( out, format );\r
-                    serial.asDOMSerializer();\r
-                    serial.serialize( doc.getDocumentElement() );\r
+                    XmlObject xml = XmlObject.Factory.parse(zip.getInputStream(entry));\r
+                    XmlOptions options = new XmlOptions();\r
+                    options.setSavePrettyPrint();\r
+                    xml.save(out, options);\r
                 } catch (Exception e){\r
                     System.err.println("Failed to parse " + entry.getName() + ", dumping raw content");\r
                     dump(zip.getInputStream(entry), out);\r