[Htmlparser-cvs] htmlparser/src/org/htmlparser/tags BaseHrefTag.java,1.34,1.35 FrameTag.java,1.32,1.
Brought to you by:
derrickoswald
From: <der...@us...> - 2003-12-29 14:18:27
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags In directory sc8-pr-cvs1:/tmp/cvs-serv29167/tags Modified Files: BaseHrefTag.java FrameTag.java Log Message: Add simplistic web site capture example application. Demonstration of using custom tags in the NodeFactory. Fixed various issues with URL rewriting. Index: BaseHrefTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/BaseHrefTag.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** BaseHrefTag.java 8 Dec 2003 01:31:52 -0000 1.34 --- BaseHrefTag.java 29 Dec 2003 14:18:23 -0000 1.35 *************** *** 71,75 **** base = getAttribute ("HREF"); if (base != null && base.length() > 0) ! base = LinkProcessor.removeLastSlash (base.trim()); base = (null == base) ? "" : base; --- 71,75 ---- base = getAttribute ("HREF"); if (base != null && base.length() > 0) ! base = base.trim (); base = (null == base) ? "" : base; *************** *** 80,90 **** { setAttribute ("HREF", base); - } - - public String toString() - { - return "BASE TAG\n"+ - "--------\n"+ - "Name : "+getBaseUrl(); } --- 80,83 ---- Index: FrameTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/FrameTag.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** FrameTag.java 8 Dec 2003 01:31:52 -0000 1.32 --- FrameTag.java 29 Dec 2003 14:18:24 -0000 1.33 *************** *** 58,71 **** /** ! * Returns the location of the frames. ! * TODO: handle base url? */ ! public String getFrameLocation() { ! String relativeFrame = getAttribute ("SRC"); ! if (relativeFrame==null) return ""; else ! return (new LinkProcessor()).extract(relativeFrame, getPage ().getUrl ()); } --- 58,82 ---- /** ! * Returns the location of the frame. ! * @return The contents of the SRC attribute converted to an absolute URL. */ ! public String getFrameLocation () { ! String src; ! ! src = getAttribute ("SRC"); ! if (null == src) return ""; else ! return (getPage ().getLinkProcessor ().extract (src, getPage ().getUrl ())); ! } ! ! /** ! * Sets the location of the frame. ! * @param url The new frame location. ! */ ! public void setFrameLocation (String url) ! { ! setAttribute ("SRC", url); } |