In my program I get an Xml from an exist database and want to place it in the hard drive.
I have made the xerces imports I need:
import org.apache.xerces.domx.XGrammarWriter.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
I have the jar on my classpath.and the code I am getting trouble with is:
OutputFormat format = new OutputFormat(doc2);
format.setIndenting(true);
XMLSerializer serializer = new XMLSerializer(new FileOutputStream(new File("C:\\Configuration\\XmlCopy.xml")), format);
I get the following errors
C:\.....\Wizard1.java:2946: cannot find symbol
symbol : constructor OutputFormat(org.w3c.dom.Document)
location: class org.apache.xerces.domx.XGrammarWriter.OutputFormat
OutputFormat format = new OutputFormat(doc2);
C:\.....\Wizard1.java:2947: cannot find symbol
symbol : method setIndenting(boolean)
location: class org.apache.xerces.domx.XGrammarWriter.OutputFormat
format.setIndenting(true);
C:\....\Wizard1.java:2948: cannot find symbol
symbol : constructor XMLSerializer(java.io.FileOutputStream,org.apache.xerces.domx.XGrammarWriter.OutputFormat)
location: class org.apache.xml.serialize.XMLSerializer
XMLSerializer serializer = new XMLSerializer(new FileOutputStream(new File("C:\\Configuration\\XmlCopy.xml")), format);
Any ideas about what I'm doing wrong?