这个压缩包里的都是超级经典的java例子
源代码在线查看: createdom.htm
Creating an Empty DOM Document (Java Developers Almanac Example)
The Java Developers Almanac 1.4
Order this book from Amazon.
google_ad_client = "pub-6001183370374757";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_channel = "4777242811";
google_ad_type = "text_image";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "6666CC";
google_color_url = "6666CC";
google_color_text = "000000";
//-->
Home
>
List of Packages
>
javax.xml.parsers
[8 examples]
>
DOM
[4 examples]
e511. Creating an Empty DOM Document
public static Document createDomDocument() {
try {
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.newDocument();
return doc;
} catch (ParserConfigurationException e) {
}
return null;
}
Related Examples
e510.
The Quintessential Program to Create a DOM Document from an XML File
e512.
Converting an XML Fragment into a DOM Fragment
e513.
Handling Errors While Parsing an XML File
See also:
DOM Parsing Options
SAX
© 2002 Addison-Wesley.