poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ye...@apache.org
Subject svn commit: r766102 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/dev/XSSFDump.java
Date Fri, 17 Apr 2009 17:59:02 GMT
Author: yegor
Date: Fri Apr 17 17:59:01 2009
New Revision: 766102

URL: http://svn.apache.org/viewvc?rev=766102&view=rev
Log:
removed deprecated code to keep javac happy

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/dev/XSSFDump.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/dev/XSSFDump.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/dev/XSSFDump.java?rev=766102&r1=766101&r2=766102&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/dev/XSSFDump.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/dev/XSSFDump.java Fri Apr 17 17:59:01 2009
@@ -16,8 +16,8 @@
 ==================================================================== */
 package org.apache.poi.xssf.dev;
 
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.w3c.dom.Document;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlOptions;
 
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.DocumentBuilder;
@@ -26,9 +26,6 @@
 import java.util.zip.ZipEntry;
 import java.util.Enumeration;
 
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-
 /**
  * Utility class which dumps the contents of a *.xlsx file into file system.
  *
@@ -68,15 +65,10 @@
 
             if(entry.getName().endsWith(".xml") || entry.getName().endsWith(".vml") || entry.getName().endsWith(".rels")){
                 try {
-                    //pass the xml through the Xerces serializer to produce nicely formatted
output
-                    Document doc = builder.parse(zip.getInputStream(entry));
-
-                    OutputFormat  format  = new OutputFormat( doc );
-                    format.setIndenting(true);
-
-                    XMLSerializer serial = new  XMLSerializer( out, format );
-                    serial.asDOMSerializer();
-                    serial.serialize( doc.getDocumentElement() );
+                    XmlObject xml = XmlObject.Factory.parse(zip.getInputStream(entry));
+                    XmlOptions options = new XmlOptions();
+                    options.setSavePrettyPrint();
+                    xml.save(out, options);
                 } catch (Exception e){
                     System.err.println("Failed to parse " + entry.getName() + ", dumping
raw content");
                     dump(zip.getInputStream(entry), out);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message