📄 xmldocument.html
字号:
<P><DD><DL><DT><B>Returns:</B><DD>the current root node</DL></DD></DL><HR><A NAME="clear()"><!-- --></A><H3>clear</H3><PRE>public void <B>clear</B>()</PRE><DL><DD>sets up an empty DOM document, with the current DOCTYPE and root node<P><DD><DL><DT><B>See Also:</B><DD><A HREF="../../../weka/core/xml/XMLDocument.html#setRootNode(java.lang.String)"><CODE>setRootNode(String)</CODE></A>, <A HREF="../../../weka/core/xml/XMLDocument.html#setDocType(java.lang.String)"><CODE>setDocType(String)</CODE></A></DL></DD></DL><HR><A NAME="newDocument(java.lang.String, java.lang.String)"><!-- --></A><H3>newDocument</H3><PRE>public org.w3c.dom.Document <B>newDocument</B>(java.lang.String docType, java.lang.String rootNode)</PRE><DL><DD>creates a new Document with the given information<P><DD><DL><DT><B>Parameters:</B><DD><CODE>docType</CODE> - the DOCTYPE definition (no checking happens!), can be null<DD><CODE>rootNode</CODE> - the name of the root node (must correspond to the one given in <code>docType</code>)<DT><B>Returns:</B><DD>returns the just created DOM document for convenience</DL></DD></DL><HR><A NAME="read(java.lang.String)"><!-- --></A><H3>read</H3><PRE>public org.w3c.dom.Document <B>read</B>(java.lang.String xml) throws java.lang.Exception</PRE><DL><DD>parses the given XML string (can be XML or a filename) and returns a DOM Document<P><DD><DL><DT><B>Parameters:</B><DD><CODE>xml</CODE> - the xml to parse (if "<?xml" is not found then it is considered a file)<DT><B>Returns:</B><DD>the parsed DOM document<DT><B>Throws:</B><DD><CODE>if</CODE> - something goes wrong with the parsing<DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="read(java.io.File)"><!-- --></A><H3>read</H3><PRE>public org.w3c.dom.Document <B>read</B>(java.io.File file) throws java.lang.Exception</PRE><DL><DD>parses the given file and returns a DOM document<P><DD><DL><DT><B>Parameters:</B><DD><CODE>file</CODE> - the XML file to parse<DT><B>Returns:</B><DD>the parsed DOM document<DT><B>Throws:</B><DD><CODE>if</CODE> - something goes wrong with the parsing<DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="read(java.io.InputStream)"><!-- --></A><H3>read</H3><PRE>public org.w3c.dom.Document <B>read</B>(java.io.InputStream stream) throws java.lang.Exception</PRE><DL><DD>parses the given stream and returns a DOM document<P><DD><DL><DT><B>Parameters:</B><DD><CODE>stream</CODE> - the XML stream to parse<DT><B>Returns:</B><DD>the parsed DOM document<DT><B>Throws:</B><DD><CODE>if</CODE> - something goes wrong with the parsing<DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="read(java.io.Reader)"><!-- --></A><H3>read</H3><PRE>public org.w3c.dom.Document <B>read</B>(java.io.Reader reader) throws java.lang.Exception</PRE><DL><DD>parses the given reader and returns a DOM document<P><DD><DL><DT><B>Parameters:</B><DD><CODE>reader</CODE> - the XML reader to parse<DT><B>Returns:</B><DD>the parsed DOM document<DT><B>Throws:</B><DD><CODE>if</CODE> - something goes wrong with the parsing<DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="write(java.lang.String)"><!-- --></A><H3>write</H3><PRE>public void <B>write</B>(java.lang.String file) throws java.lang.Exception</PRE><DL><DD>writes the current DOM document into the given file<P><DD><DL><DT><B>Parameters:</B><DD><CODE>file</CODE> - the filename to write to<DT><B>Throws:</B><DD><CODE>if</CODE> - something goes wrong with the parsing<DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="write(java.io.File)"><!-- --></A><H3>write</H3><PRE>public void <B>write</B>(java.io.File file) throws java.lang.Exception</PRE><DL><DD>writes the current DOM document into the given file<P><DD><DL><DT><B>Parameters:</B><DD><CODE>file</CODE> - the filename to write to<DT><B>Throws:</B><DD><CODE>if</CODE> - something goes wrong with the parsing<DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="write(java.io.OutputStream)"><!-- --></A><H3>write</H3><PRE>public void <B>write</B>(java.io.OutputStream stream) throws java.lang.Exception</PRE><DL><DD>writes the current DOM document into the given stream<P><DD><DL><DT><B>Throws:</B><DD><CODE>if</CODE> - something goes wrong with the parsing<DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="write(java.io.Writer)"><!-- --></A><H3>write</H3><PRE>public void <B>write</B>(java.io.Writer writer) throws java.lang.Exception</PRE><DL><DD>writes the current DOM document into the given writer<P><DD><DL><DT><B>Throws:</B><DD><CODE>if</CODE> - something goes wrong with the parsing<DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="getChildTags(org.w3c.dom.Node)"><!-- --></A><H3>getChildTags</H3><PRE>public static java.util.Vector <B>getChildTags</B>(org.w3c.dom.Node parent)</PRE><DL><DD>returns all non tag-children from the given node<P><DD><DL><DT><B>Parameters:</B><DD><CODE>parent</CODE> - the node to get the children from<DT><B>Returns:</B><DD>a vector containing all the non-text children</DL></DD></DL><HR><A NAME="getContent(org.w3c.dom.Element)"><!-- --></A><H3>getContent</H3><PRE>public static java.lang.String <B>getContent</B>(org.w3c.dom.Element node)</PRE><DL><DD>returns the text between the opening and closing tag of a node (performs a <code>trim()</code> on the result)<P><DD><DL><DT><B>Parameters:</B><DD><CODE>node</CODE> - the node to get the text from<DT><B>Returns:</B><DD>the content of the given node</DL></DD></DL><HR><A NAME="print()"><!-- --></A><H3>print</H3><PRE>public void <B>print</B>()</PRE><DL><DD>prints the current DOM document to standard out<P><DD><DL></DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public java.lang.String <B>toString</B>()</PRE><DL><DD>returns the current DOM document as XML-string<P><DD><DL><DT><B>Returns:</B><DD>the document as XML-string representation<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if anything goes wrong initializing the parsing</DL></DD></DL><HR><A NAME="main(java.lang.String[])"><!-- --></A><H3>main</H3><PRE>public static void <B>main</B>(java.lang.String[] args) throws java.lang.Exception</PRE><DL><DD>for testing only. takes the name of an XML file as first arg, reads that file, prints it to stdout and if a second filename is given, writes the parsed document to that again.<P><DD><DL><DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../Tutorial.pdf"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="http://www.cs.waikato.ac.nz/ml/weka/index.html"><FONT CLASS="NavBarFont1"><B>Weka's home</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../weka/core/xml/XMLBasicSerialization.html" title="class in weka.core.xml"><B>PREV CLASS</B></A> <A HREF="../../../weka/core/xml/XMLOptions.html" title="class in weka.core.xml"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="XMLDocument.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -