xmldocument.html

来自「数据挖掘的最常用工具。由于开源」· HTML 代码 · 共 1,537 行 · 第 1/4 页

HTML
1,537
字号
<DD><DL></DL></DD><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>java.lang.Exception</CODE> - if something goes wrong with the parsing</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&nbsp;reader)                          throws java.lang.Exception</PRE><DL><DD>parses the given reader and returns a DOM document.<P><DD><DL></DL></DD><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>java.lang.Exception</CODE> - if something goes wrong with the parsing</DL></DD></DL><HR><A NAME="write(java.lang.String)"><!-- --></A><H3>write</H3><PRE>public void <B>write</B>(java.lang.String&nbsp;file)           throws java.lang.Exception</PRE><DL><DD>writes the current DOM document into the given file.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>file</CODE> - the filename to write to<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if something goes wrong with the parsing</DL></DD></DL><HR><A NAME="write(java.io.File)"><!-- --></A><H3>write</H3><PRE>public void <B>write</B>(java.io.File&nbsp;file)           throws java.lang.Exception</PRE><DL><DD>writes the current DOM document into the given file.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>file</CODE> - the filename to write to<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if something goes wrong with the parsing</DL></DD></DL><HR><A NAME="write(java.io.OutputStream)"><!-- --></A><H3>write</H3><PRE>public void <B>write</B>(java.io.OutputStream&nbsp;stream)           throws java.lang.Exception</PRE><DL><DD>writes the current DOM document into the given stream.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>stream</CODE> - the filename to write to<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if something goes wrong with the parsing</DL></DD></DL><HR><A NAME="write(java.io.Writer)"><!-- --></A><H3>write</H3><PRE>public void <B>write</B>(java.io.Writer&nbsp;writer)           throws java.lang.Exception</PRE><DL><DD>writes the current DOM document into the given writer.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>writer</CODE> - the filename to write to<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if something goes wrong with the parsing</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&nbsp;parent)</PRE><DL><DD>returns all non tag-children from the given node.<P><DD><DL></DL></DD><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="getChildTags(org.w3c.dom.Node, java.lang.String)"><!-- --></A><H3>getChildTags</H3><PRE>public static java.util.Vector <B>getChildTags</B>(org.w3c.dom.Node&nbsp;parent,                                            java.lang.String&nbsp;name)</PRE><DL><DD>returns all non tag-children from the given node.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parent</CODE> - the node to get the children from<DD><CODE>name</CODE> - the name of the tags to return, "" for all<DT><B>Returns:</B><DD>a vector containing all the non-text children</DL></DD></DL><HR><A NAME="findNodes(java.lang.String)"><!-- --></A><H3>findNodes</H3><PRE>public org.w3c.dom.NodeList <B>findNodes</B>(java.lang.String&nbsp;xpath)</PRE><DL><DD>Returns the nodes that the given xpath expression will find in the  document. Can return null if an error occurred.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>xpath</CODE> - the XPath expression to run on the document<DT><B>Returns:</B><DD>the nodelist</DL></DD></DL><HR><A NAME="getNode(java.lang.String)"><!-- --></A><H3>getNode</H3><PRE>public org.w3c.dom.Node <B>getNode</B>(java.lang.String&nbsp;xpath)</PRE><DL><DD>Returns the node represented by the XPath expression.  Can return null if an error occurred.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>xpath</CODE> - the XPath expression to run on the document<DT><B>Returns:</B><DD>the node</DL></DD></DL><HR><A NAME="evalBoolean(java.lang.String)"><!-- --></A><H3>evalBoolean</H3><PRE>public java.lang.Boolean <B>evalBoolean</B>(java.lang.String&nbsp;xpath)</PRE><DL><DD>Evaluates and returns the boolean result of the XPath expression.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>xpath</CODE> - the expression to evaluate<DT><B>Returns:</B><DD>the result of the evaluation, null in case of an error</DL></DD></DL><HR><A NAME="evalDouble(java.lang.String)"><!-- --></A><H3>evalDouble</H3><PRE>public java.lang.Double <B>evalDouble</B>(java.lang.String&nbsp;xpath)</PRE><DL><DD>Evaluates and returns the double result of the XPath expression.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>xpath</CODE> - the expression to evaluate<DT><B>Returns:</B><DD>the result of the evaluation, null in case of                        an error</DL></DD></DL><HR><A NAME="evalString(java.lang.String)"><!-- --></A><H3>evalString</H3><PRE>public java.lang.String <B>evalString</B>(java.lang.String&nbsp;xpath)</PRE><DL><DD>Evaluates and returns the boolean result of the XPath expression.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>xpath</CODE> - the expression to evaluate<DT><B>Returns:</B><DD>the result of the evaluation</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&nbsp;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></DL></DD><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><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>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the document as XML-string representation</DL></DD></DL><HR><A NAME="getRevision()"><!-- --></A><H3>getRevision</H3><PRE>public java.lang.String <B>getRevision</B>()</PRE><DL><DD>Returns the revision string.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../weka/core/RevisionHandler.html#getRevision()">getRevision</A></CODE> in interface <CODE><A HREF="../../../weka/core/RevisionHandler.html" title="interface in weka.core">RevisionHandler</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the revision</DL></DD></DL><HR><A NAME="main(java.lang.String[])"><!-- --></A><H3>main</H3><PRE>public static void <B>main</B>(java.lang.String[]&nbsp;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></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>args</CODE> - the commandline arguments<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if something goes wrong</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=2 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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="http://www.cs.waikato.ac.nz/ml/weka/" target="_blank"><FONT CLASS="NavBarFont1"><B>Weka's home</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../weka/core/xml/XMLBasicSerialization.html" title="class in weka.core.xml"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../weka/core/xml/XMLInstances.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?weka/core/xml/XMLDocument.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="XMLDocument.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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 + =
减小字号Ctrl + -
显示快捷键?