diff options
author | Yegor Kozlov <yegor@apache.org> | 2009-04-17 17:59:01 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2009-04-17 17:59:01 +0000 |
commit | 2ab0a58566226570ecbf55b7700cfb31d1e60a74 (patch) | |
tree | cf74fb6108ba31899e5b8758d893ea331bff3755 /src | |
parent | 5b3b14f377fbd5e4ebeee46e5cbf669ff1533827 (diff) | |
download | poi-2ab0a58566226570ecbf55b7700cfb31d1e60a74.tar.gz poi-2ab0a58566226570ecbf55b7700cfb31d1e60a74.zip |
removed deprecated code to keep javac happy
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@766102 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rwxr-xr-x | src/ooxml/java/org/apache/poi/xssf/dev/XSSFDump.java | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/dev/XSSFDump.java b/src/ooxml/java/org/apache/poi/xssf/dev/XSSFDump.java index 3bb60e9034..30a800e531 100755 --- a/src/ooxml/java/org/apache/poi/xssf/dev/XSSFDump.java +++ b/src/ooxml/java/org/apache/poi/xssf/dev/XSSFDump.java @@ -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.ZipFile; 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 @@ public class XSSFDump { 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);
|