import java.io.File;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
public class Main {
public static void main(String[] argv) throws Exception {
Document doc = null;
String filename = "name.xml";
Source source = new DOMSource(doc);
File file = new File(filename);
Result result = new StreamResult(file);
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.transform(source, result);
}
}
sources68 the directory containing the programming examples, source code and programming guide online
Saturday, 30 July 2011
Writing a DOM Document to an XML File
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment