Update of //cvsroot/htmlparser/htmlparser/src/org/htmlparser/util
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv27353/util
Modified Files:
NodeList.java
Log Message:
implement task #93148 toHtml(boolean verbatim)
To avoid printing generated end tags use toHtml(true).
Index: NodeList.java
===================================================================
RCS file: //cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/NodeList.java,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** NodeList.java 14 Apr 2006 22:18:47 -0000 1.61
--- NodeList.java 31 May 2006 02:10:15 -0000 1.62
***************
*** 159,172 ****
/**
* Convert this nodelist into the equivalent HTML.
* @return The contents of the list as HTML text.
*/
public String toHtml ()
{
! StringBuffer buff = new StringBuffer ();
! for (int i=0;i<size;i++)
! buff.append (nodeData[i].toHtml ());
! return buff.toString ();
}
!
/**
* Remove the node at index.
--- 159,186 ----
/**
* Convert this nodelist into the equivalent HTML.
+ * @param verbatim If <code>true</code> return as close to the original
+ * page text as possible.
+ * @return The contents of the list as HTML text.
+ */
+ public String toHtml (boolean verbatim)
+ {
+ StringBuffer ret;
+
+ ret = new StringBuffer ();
+ for (int i = 0; i < size; i++)
+ ret.append (nodeData[i].toHtml (verbatim));
+
+ return (ret.toString ());
+ }
+
+ /**
+ * Convert this nodelist into the equivalent HTML.
* @return The contents of the list as HTML text.
*/
public String toHtml ()
{
! return (toHtml (false));
}
!
/**
* Remove the node at index.
|