java类库详细讲解
源代码在线查看: createdom.html
Creating an Empty DOM Document
(Java Developers Almanac Example)
BODY CODE {font-family: Courier, Monospace; font-size: 11pt} TABLE, BODY {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt} PRE {font-family: Courier, Monospace; font-size: 10pt} H3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11pt} A.eglink {text-decoration: none} A:hover.eglink {text-decoration: underline} -->
The Java Developers Almanac 1.4
Order this book from Amazon.
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.