[Htmlparser-cvs] htmlparser/src/org/htmlparser/lexerapplications/thumbelina Thumbelina.java,1.1,1.2
Brought to you by:
derrickoswald
From: <der...@us...> - 2003-10-26 16:44:13
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexerapplications/thumbelina In directory sc8-pr-cvs1:/tmp/cvs-serv28296 Modified Files: Thumbelina.java Log Message: Get thumbelina working again. The tag.getName() method doesn't include the / of end tags. Index: Thumbelina.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexerapplications/thumbelina/Thumbelina.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Thumbelina.java 21 Sep 2003 18:20:56 -0000 1.1 --- Thumbelina.java 26 Oct 2003 16:44:01 -0000 1.2 *************** *** 791,841 **** if ("A".equals (name)) { ! startatag = tag; ! imgtag = null; ! ina = true; ! href = startatag.getAttribute ("HREF"); ! if (null != href) { ! if (!isImage (href)) ! try ! { ! url = new URL (docbase, href); ! // eliminate duplicates ! href = url.toExternalForm (); ! if (!links.containsKey (href)) ! links.put (href, url); ! } ! catch (MalformedURLException murle) { ! // well, obviously we don't want this one } } ! } ! else if ("/A".equals (name)) ! { ! ina = false; ! if (null != imgtag) { ! // evidence of a thumb href = startatag.getAttribute ("HREF"); if (null != href) { ! if (isImage (href)) ! { ! src = imgtag.getAttribute ("SRC"); ! if (null != src) ! try ! { ! url = new URL (docbase, href); ! // eliminate duplicates ! href = url.toExternalForm (); ! if (!images.containsKey (href)) ! images.put (href, url); ! } ! catch (MalformedURLException murle) ! { ! // oops, forget it ! } ! } } } --- 791,844 ---- if ("A".equals (name)) { ! if (tag.isEndTag ()) { ! ina = false; ! if (null != imgtag) ! { ! // evidence of a thumb ! href = startatag.getAttribute ("HREF"); ! if (null != href) { ! if (isImage (href)) ! { ! src = imgtag.getAttribute ("SRC"); ! if (null != src) ! try ! { ! url = new URL (docbase, href); ! // eliminate duplicates ! href = url.toExternalForm (); ! if (!images.containsKey (href)) ! images.put (href, url); ! } ! catch (MalformedURLException murle) ! { ! // oops, forget it ! } ! } } + } } ! else { ! startatag = tag; ! imgtag = null; ! ina = true; href = startatag.getAttribute ("HREF"); if (null != href) { ! if (!isImage (href)) ! try ! { ! url = new URL (docbase, href); ! // eliminate duplicates ! href = url.toExternalForm (); ! if (!links.containsKey (href)) ! links.put (href, url); ! } ! catch (MalformedURLException murle) ! { ! // well, obviously we don't want this one ! } } } *************** *** 1424,1427 **** --- 1427,1433 ---- * * $Log$ + * Revision 1.2 2003/10/26 16:44:01 derrickoswald + * Get thumbelina working again. The tag.getName() method doesn't include the / of end tags. + * * Revision 1.1 2003/09/21 18:20:56 derrickoswald * Thumbelina |