Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags
In directory sc8-pr-cvs1:/tmp/cvs-serv10542/tags
Modified Files:
AppletTag.java
Log Message:
Partition Attribute into a base class and PageAttribute class for the Lexer.
Fixed the AppletTag.setAppletParams in a cheesy manner.
Clear out the released NodeList entry on remove().
Dropped the HTMLTagParserTest tests, because they really weren't relevant any more.
Index: AppletTag.java
===================================================================
RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/AppletTag.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** AppletTag.java 28 Sep 2003 15:33:58 -0000 1.30
--- AppletTag.java 18 Oct 2003 20:50:37 -0000 1.31
***************
*** 31,36 ****
--- 31,39 ----
import java.util.Enumeration;
import java.util.Hashtable;
+ import java.util.Vector;
import org.htmlparser.Node;
+ import org.htmlparser.StringNode;
+ import org.htmlparser.lexer.nodes.Attribute;
import org.htmlparser.tags.data.CompositeTagData;
import org.htmlparser.tags.data.TagData;
***************
*** 167,172 ****
String paramName;
String paramValue;
! String s;
! TagData tagData;
kids = getChildren ();
--- 170,176 ----
String paramName;
String paramValue;
! Vector attributes;
! Attribute attribute;
! StringNode string;
kids = getChildren ();
***************
*** 177,181 ****
--- 181,198 ----
if (node instanceof Tag)
if (((Tag)node).getTagName ().equals ("PARAM"))
+ {
kids.remove (i);
+ // remove whitespace too
+ if (i < kids.size ())
+ {
+ node = kids.elementAt (i);
+ if (node instanceof StringNode)
+ {
+ string = (StringNode)node;
+ if (0 == string.getText ().trim ().length ())
+ kids.remove (i);
+ }
+ }
+ }
else
i++;
***************
*** 187,196 ****
for (Enumeration e = newAppletParams.keys (); e.hasMoreElements (); )
{
paramName = (String)e.nextElement ();
paramValue = (String)newAppletParams.get (paramName);
! s = "PARAM VALUE=\"" + paramValue + "\" NAME=\"" + paramName + "\"";
! throw new IllegalStateException ("not implemented");
! // tagData = new TagData (0, 0, 0, 0, s, s, "", false); // what, no URL?
! // kids.add (new Tag (tagData));
}
--- 204,224 ----
for (Enumeration e = newAppletParams.keys (); e.hasMoreElements (); )
{
+ attributes = new Vector (); // should the tag copy the attributes?
paramName = (String)e.nextElement ();
paramValue = (String)newAppletParams.get (paramName);
! attribute = new Attribute ("PARAM", null);
! System.out.println (attribute);
! attributes.addElement (attribute);
! attributes.addElement (new Attribute (" "));
! attribute = new Attribute ("VALUE", paramValue, '"');
! System.out.println (attribute);
! attributes.addElement (attribute);
! attributes.addElement (new Attribute (" "));
! attribute = new Attribute ("NAME", paramName, '"');
! System.out.println (attribute);
! attributes.addElement (attribute);
! tag = new Tag (null, 0, 0, attributes);
! System.out.println (tag.toHtml ());
! kids.add (tag);
}
|