==================================================================== */\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
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
\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