Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

xerces cannot find symbol problem

807580Sep 21 2009 — edited Sep 22 2009
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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 20 2009
Added on Sep 21 2009
8 comments
290 views