documentbuilder.html
来自「j2ee api,很好的api。我这现在有」· HTML 代码 · 共 570 行 · 第 1/3 页
HTML
570 行
<TD><CODE><B><A HREF="../../../javax/xml/parsers/DocumentBuilder.html#newDocument()">newDocument</A></B>()</CODE><BR> Obtain a new instance of a DOM <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom"><CODE>Document</CODE></A> object to build a DOM tree with. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom">Document</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/parsers/DocumentBuilder.html#parse(java.io.File)">parse</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/File.html" title="class or interface in java.io">File</A> f)</CODE><BR> Parse the content of the given file as an XML document and return a new DOM <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom"><CODE>Document</CODE></A> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom">Document</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/parsers/DocumentBuilder.html#parse(org.xml.sax.InputSource)">parse</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/InputSource.html" title="class or interface in org.xml.sax">InputSource</A> is)</CODE><BR> Parse the content of the given input source as an XML document and return a new DOM <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom"><CODE>Document</CODE></A> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom">Document</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/parsers/DocumentBuilder.html#parse(java.io.InputStream)">parse</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A> is)</CODE><BR> Parse the content of the given <code>InputStream</code> as an XML document and return a new DOM <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom"><CODE>Document</CODE></A> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom">Document</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/parsers/DocumentBuilder.html#parse(java.io.InputStream, java.lang.String)">parse</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A> is, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> systemId)</CODE><BR> Parse the content of the given <code>InputStream</code> as an XML document and return a new DOM <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom"><CODE>Document</CODE></A> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom">Document</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/parsers/DocumentBuilder.html#parse(java.lang.String)">parse</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> uri)</CODE><BR> Parse the content of the given URI as an XML document and return a new DOM <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom"><CODE>Document</CODE></A> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/parsers/DocumentBuilder.html#setEntityResolver(org.xml.sax.EntityResolver)">setEntityResolver</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/EntityResolver.html" title="class or interface in org.xml.sax">EntityResolver</A> er)</CODE><BR> Specify the <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/EntityResolver.html" title="class or interface in org.xml.sax"><CODE>EntityResolver</CODE></A> to be used to resolve entities present in the XML document to be parsed. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/parsers/DocumentBuilder.html#setErrorHandler(org.xml.sax.ErrorHandler)">setErrorHandler</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/ErrorHandler.html" title="class or interface in org.xml.sax">ErrorHandler</A> eh)</CODE><BR> Specify the <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/ErrorHandler.html" title="class or interface in org.xml.sax"><CODE>ErrorHandler</CODE></A> to be used to report errors present in the XML document to be parsed. </TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="DocumentBuilder()"><!-- --></A><H3>DocumentBuilder</H3><PRE>protected <B>DocumentBuilder</B>()</PRE><DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="parse(java.io.InputStream)"><!-- --></A><H3>parse</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom">Document</A> <B>parse</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A> is) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/SAXException.html" title="class or interface in org.xml.sax">SAXException</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Parse the content of the given <code>InputStream</code> as an XML document and return a new DOM <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom"><CODE>Document</CODE></A> object.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>is</CODE> - InputStream containing the content to be parsed.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - If any IO errors occur.<DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/SAXException.html" title="class or interface in org.xml.sax">SAXException</A></CODE> - If any parse errors occur.<DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - If the InputStream is null<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/DocumentHandler.html" title="class or interface in org.xml.sax"><CODE>DocumentHandler</CODE></A></DL></DD></DL><HR><A NAME="parse(java.io.InputStream, java.lang.String)"><!-- --></A><H3>parse</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom">Document</A> <B>parse</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A> is, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> systemId) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/SAXException.html" title="class or interface in org.xml.sax">SAXException</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Parse the content of the given <code>InputStream</code> as an XML document and return a new DOM <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom"><CODE>Document</CODE></A> object.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>is</CODE> - InputStream containing the content to be parsed.<DD><CODE>systemId</CODE> - Provide a base for resolving relative URIs.<DT><B>Returns:</B><DD>A new DOM Document object.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - If any IO errors occur.<DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/SAXException.html" title="class or interface in org.xml.sax">SAXException</A></CODE> - If any parse errors occur.<DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - If the InputStream is null.<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/DocumentHandler.html" title="class or interface in org.xml.sax"><CODE>DocumentHandler</CODE></A></DL></DD></DL><HR><A NAME="parse(java.lang.String)"><!-- --></A><H3>parse</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom">Document</A> <B>parse</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> uri) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/SAXException.html" title="class or interface in org.xml.sax">SAXException</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Parse the content of the given URI as an XML document and return a new DOM <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom"><CODE>Document</CODE></A> object.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>uri</CODE> - The location of the content to be parsed.<DT><B>Returns:</B><DD>A new DOM Document object.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - If any IO errors occur.<DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/SAXException.html" title="class or interface in org.xml.sax">SAXException</A></CODE> - If any parse errors occur.<DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - If the URI is null.<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/DocumentHandler.html" title="class or interface in org.xml.sax"><CODE>DocumentHandler</CODE></A></DL></DD></DL><HR><A NAME="parse(java.io.File)"><!-- --></A><H3>parse</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom">Document</A> <B>parse</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/File.html" title="class or interface in java.io">File</A> f) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/xml/sax/SAXException.html" title="class or interface in org.xml.sax">SAXException</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Parse the content of the given file as an XML document and return a new DOM <A HREF="http://java.sun.com/j2se/1.4/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom"><CODE>Document</CODE></A> object.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>f</CODE> - The file containing the XML to parse.<DT><B>Returns:</B><DD>A new DOM Document object.<DT><B>Throws:</B>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?