3.x RC1 compatibility
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / util / xml / XMLHelper.java
index bf16296..9fdeeef 100644 (file)
@@ -10,9 +10,8 @@ import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.FactoryConfigurationError;
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.apache.xml.serialize.DOMSerializer;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
+import org.apache.xalan.serialize.DOMSerializer;
+import org.apache.xalan.serialize.SerializerToXML;
 import org.w3c.dom.Document;
 import org.xml.sax.SAXException;
 
@@ -28,21 +27,27 @@ public class XMLHelper {
     
     public static DOMSerializer createDOMSerializer(Writer writer) 
         throws IOException {
-        XMLSerializer serializer = new XMLSerializer(writer, createOutputFormat());
+//      XMLSerializer serializer = new XMLSerializer(writer, createOutputFormat());
+//     return serializer.asDOMSerializer();
+       SerializerToXML serializer = new SerializerToXML();
+        serializer.setWriter(writer);
         return serializer.asDOMSerializer();
     }
 
     public static DOMSerializer createDOMSerializer(OutputStream stream) 
         throws IOException {
-        XMLSerializer serializer = new XMLSerializer(stream, createOutputFormat());
+//      XMLSerializer serializer = new XMLSerializer(stream, createOutputFormat());
+//      return serializer.asDOMSerializer();
+        SerializerToXML serializer = new SerializerToXML();
+        serializer.setOutputStream(stream);
         return serializer.asDOMSerializer();
     }
-    private static OutputFormat createOutputFormat() {
-        OutputFormat format = new OutputFormat();
-        format.setIndenting(true);
-        format.setLineWidth(80);
-        return format;
-    }
+//    private static OutputFormat createOutputFormat() {
+//        OutputFormat format = new OutputFormat();
+//        format.setIndenting(true);
+//        format.setLineWidth(80);
+//        return format;
+//    }
     
     public static Document createEmptyDocument() throws ParserConfigurationException {
         DocumentBuilder builder = createDocumentBuilder();