jsalvata    2003/12/11 16:40:12

  Modified:    src/protocol/http/org/apache/jmeter/protocol/http/parser
                        JTidyHTMLParser.java
  Log:
  Made Base HRef implementation work (code was there,
  but was totally useless).
  
  Revision  Changes    Path
  1.6       +10 -6     
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/parser/JTidyHTMLParser.java
  
  Index: JTidyHTMLParser.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/parser/JTidyHTMLParser.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JTidyHTMLParser.java      27 Nov 2003 02:53:15 -0000      1.5
  +++ JTidyHTMLParser.java      12 Dec 2003 00:40:12 -0000      1.6
  @@ -124,11 +124,13 @@
         * @param node - initial node
         * @param urls - container for URLs
         * @param baseUrl - used to create absolute URLs
  +     * 
  +     * @return new base URL
         */
  -     private void scanNodes(Node node, Collection urls, URL baseUrl)
  +     private URL scanNodes(Node node, Collection urls, URL baseUrl) throws 
HTMLParseException
        {
                if ( node == null ) {
  -               return;
  +               return baseUrl;
            }
   
            String name = node.getNodeName();
  @@ -149,11 +151,11 @@
                        String tmp=getValue(attrs,"href");
                        if (tmp!=null) try
               {
  -                baseUrl=new URL(tmp);
  +                baseUrl= new URL(baseUrl, tmp);
               }
               catch (MalformedURLException e)
               {
  -             log.warn("Invalid BASE tag "+tmp);
  +             throw new HTMLParseException(e);
               }
                        break;
                  }
  @@ -193,7 +195,7 @@
                  if ( children != null ) {
                         int len = children.getLength();
                         for ( int i = 0; i < len; i++ ) {
  -                             scanNodes(children.item(i),urls,baseUrl);
  +                             baseUrl= scanNodes(children.item(i),urls,baseUrl);
                         }
                  }
                  break;
  @@ -202,6 +204,8 @@
   //             break;
   
           }
  +       
  +       return baseUrl;
   
        }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to