[Htmlparser-cvs] htmlparser/src/org/htmlparser/tags BaseHrefTag.java,1.37,1.38 FormTag.java,1.47,1.4
Brought to you by:
derrickoswald
From: Derrick O. <der...@us...> - 2004-03-18 04:13:47
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24099/src/org/htmlparser/tags Modified Files: BaseHrefTag.java FormTag.java FrameTag.java ImageTag.java LinkTag.java Log Message: Deprecate LinkProcessor. Functionality moved to Page. Index: ImageTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/ImageTag.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** ImageTag.java 29 Feb 2004 12:52:21 -0000 1.43 --- ImageTag.java 18 Mar 2004 04:04:08 -0000 1.44 *************** *** 126,130 **** { // missing equals sign ! ret = string.substring (3); state = 0; // go back to searching for SRC // because, maybe we found SRCXXX --- 126,137 ---- { // missing equals sign ! string = string.substring (3); ! // remove any double quotes from around string ! if (string.startsWith ("\"") && string.endsWith ("\"") && (1 < string.length ())) ! string = string.substring (1, string.length () - 1); ! // remove any single quote from around string ! if (string.startsWith ("'") && string.endsWith ("'") && (1 < string.length ())) ! string = string.substring (1, string.length () - 1); ! ret = string; state = 0; // go back to searching for SRC // because, maybe we found SRCXXX *************** *** 178,182 **** if (null == imageURL) if (null != getPage ()) ! imageURL = getPage ().getLinkProcessor ().extract (extractImageLocn (), getPage().getUrl ()); return (imageURL); } --- 185,190 ---- if (null == imageURL) if (null != getPage ()) ! imageURL = getPage ().getAbsoluteURL (extractImageLocn ()); ! return (imageURL); } Index: FrameTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/FrameTag.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** FrameTag.java 14 Jan 2004 02:53:46 -0000 1.35 --- FrameTag.java 18 Mar 2004 04:04:08 -0000 1.36 *************** *** 59,69 **** public String getFrameLocation () { ! String src; ! src = getAttribute ("SRC"); ! if (null == src) ! return ""; ! else ! return (getPage ().getLinkProcessor ().extract (src, getPage ().getUrl ())); } --- 59,71 ---- public String getFrameLocation () { ! String ret; ! ret = getAttribute ("SRC"); ! if (null == ret) ! ret = ""; ! else if (null != getPage ()) ! ret = getPage ().getAbsoluteURL (ret); ! ! return (ret); } Index: LinkTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/LinkTag.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** LinkTag.java 29 Feb 2004 12:52:21 -0000 1.48 --- LinkTag.java 18 Mar 2004 04:04:08 -0000 1.49 *************** *** 318,332 **** /** * Extract the link from the HREF attribute. ! * The URL of the actual html page is also provided. */ public String extractLink () { ! String relativeLink = getAttribute ("HREF"); ! if (relativeLink!=null) { ! relativeLink = ParserUtils.removeChars(relativeLink,'\n'); ! relativeLink = ParserUtils.removeChars(relativeLink,'\r'); } ! return (getPage ().getLinkProcessor ().extract (relativeLink, getPage ().getUrl ())); } } --- 318,338 ---- /** * Extract the link from the HREF attribute. ! * @return The URL from the HREF attibute. This is absolute if the tag has ! * a valid page. */ public String extractLink () { ! String ret; ! ! ret = getAttribute ("HREF"); ! if (null != ret) { ! ret = ParserUtils.removeChars (ret,'\n'); ! ret = ParserUtils.removeChars (ret,'\r'); } ! if (null != getPage ()) ! ret = getPage ().getAbsoluteURL (ret); ! ! return (ret); } } Index: FormTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/FormTag.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** FormTag.java 24 Jan 2004 23:57:52 -0000 1.47 --- FormTag.java 18 Mar 2004 04:04:08 -0000 1.48 *************** *** 115,119 **** if (null == mFormLocation) // ... is it true that without an ACTION the default is to send it back to the same page? ! mFormLocation = extractFormLocn (getPage ().getUrl ()); return (mFormLocation); --- 115,119 ---- if (null == mFormLocation) // ... is it true that without an ACTION the default is to send it back to the same page? ! mFormLocation = extractFormLocn (); return (mFormLocation); *************** *** 215,227 **** * @param url URL of web page being parsed. */ ! public String extractFormLocn(String url)// throws ParserException { ! String formURL; ! formURL = getAttribute("ACTION"); ! if (null == formURL) ! return ""; ! else ! return (getPage ().getLinkProcessor ().extract (formURL, url)); } } --- 215,229 ---- * @param url URL of web page being parsed. */ ! public String extractFormLocn () { ! String ret; ! ret = getAttribute("ACTION"); ! if (null == ret) ! ret = ""; ! else if (null != getPage ()) ! ret = getPage ().getAbsoluteURL (ret); ! ! return (ret); } } Index: BaseHrefTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/BaseHrefTag.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** BaseHrefTag.java 14 Jan 2004 02:53:46 -0000 1.37 --- BaseHrefTag.java 18 Mar 2004 04:04:08 -0000 1.38 *************** *** 89,93 **** if (null != page) { ! page.getLinkProcessor ().setBaseUrl (getBaseUrl ()); } } --- 89,93 ---- if (null != page) { ! page.setBaseUrl (getBaseUrl ()); } } |