Package org.htmlparser.tags

Examples of org.htmlparser.tags.ImageTag.toHtml()


          else{
            int idx = link.lastIndexOf('/');
            img.setImageURL(link.substring(0, idx) + '/' + img_url);
          }
        }
        content.append(img.toHtml());
        //System.out.println(img.getImageURL());
      }
    }catch(Exception e){}
    content.append(desc.substring(last_pos));
    return content.toString();
View Full Code Here


       if (DebugFile.trace) DebugFile.writeln("HashMap.put(" + sSrc + "," + sCid + ")");

        oDocumentImages.put(sCid, sSrc);
      } // fi (oDocumentImages.containsKey(sCid))

    sTag = oImgNode.toHtml(true);

    if (DebugFile.trace) DebugFile.writeln("Util.substitute([Perl5Matcher], "+oPattern.getPattern()+", new Perl5Substitution(cid:"+oDocumentImages.get(sCid)+", Perl5Substitution.INTERPOLATE_ALL)"+", "+sTag+ ", Util.SUBSTITUTE_ALL)");

    oBuffer.append(Util.substitute(oMatcher, oPattern,
                                   new Perl5Substitution("cid:"+sCid,
View Full Code Here

            node[0] instanceof ImageTag);
        ImageTag imageTag = (ImageTag) node[0];
        assertStringEquals(
            "The image locn",
            "<IMG WIDTH=\"305\" ALT=\"Google\" SRC=\"../../goo/title_homepage4.gif\" HEIGHT=\"115\">",
            imageTag.toHtml());
        assertEquals("Alt", "Google", imageTag.getAttribute("alt"));
        assertEquals("Height", "115", imageTag.getAttribute("height"));
        assertEquals("Width", "305", imageTag.getAttribute("width"));
    }
}
View Full Code Here

        createParser(img,"http://www.google.com/test/test/index.html");
        parseAndAssertNodeCount(1);
        // The node should be an ImageTag
        assertTrue("Node should be a ImageTag",node[0] instanceof ImageTag);
        ImageTag imageTag = (ImageTag)node[0];
        assertStringEquals("toHtml",img,imageTag.toHtml());
        assertEquals("Alt","Google",imageTag.getAttribute("alt"));
        assertEquals("Height","115",imageTag.getAttribute("height"));
        assertEquals("Width","305",imageTag.getAttribute("width"));
    }
View Full Code Here

        parseAndAssertNodeCount (1);
        assertTrue ("Node should be an ImageTag", node[0] instanceof ImageTag);
        ImageTag img = (ImageTag)node[0];
        assertTrue ("bad source", "images/first".equals (img.getImageURL ()));
        assertTrue ("bad alt", "first".equals (img.getAttribute ("alt")));
        assertStringEquals ("toHtml()", html, img.toHtml ());
    }

    /**
     * see bug #778781 SRC-attribute suppression in IMG-tags
     */
 
View Full Code Here

        parseAndAssertNodeCount (1);
        assertTrue ("Node should be an ImageTag", node[0] instanceof ImageTag);
        ImageTag img = (ImageTag)node[0];
        assertTrue ("bad source", "images/second".equals (img.getImageURL ()));
        assertTrue ("bad alt", "".equals (img.getAttribute ("alt")));
        assertStringEquals ("toHtml()", html, img.toHtml ());
    }

    /**
     * see bug #778781 SRC-attribute suppression in IMG-tags
     */
 
View Full Code Here

        parseAndAssertNodeCount (1);
        assertTrue ("Node should be an ImageTag", node[0] instanceof ImageTag);
        ImageTag img = (ImageTag)node[0];
        assertTrue ("bad source", "images/third".equals (img.getImageURL ()));
        assertTrue ("bad alt", "third".equals (img.getAttribute ("alt")));
        assertStringEquals ("toHtml()", html, img.toHtml ());
    }

    /**
     * see bug #778781 SRC-attribute suppression in IMG-tags
     */
 
View Full Code Here

        parseAndAssertNodeCount (1);
        assertTrue ("Node should be an ImageTag", node[0] instanceof ImageTag);
        ImageTag img = (ImageTag)node[0];
        assertTrue ("bad source", "images/third".equals (img.getImageURL ()));
        assertTrue ("bad alt", "".equals (img.getAttribute ("alt")));
        assertStringEquals ("toHtml()", html, img.toHtml ());
    }

    /**
     * see bug #911565 isValued() and isNull() don't work
     */
 
View Full Code Here

    parseAndAssertNodeCount(1);
    // The node should be an HTMLImageTag
    assertTrue("Node should be a HTMLImageTag", node[0] instanceof ImageTag);
    ImageTag imageTag = (ImageTag) node[0];
    assertStringEquals("The image locn",
        "<IMG WIDTH=\"305\" ALT=\"Google\" SRC=\"../../goo/title_homepage4.gif\" HEIGHT=\"115\">", imageTag
            .toHtml());
    assertEquals("Alt", "Google", imageTag.getAttribute("alt"));
    assertEquals("Height", "115", imageTag.getAttribute("height"));
    assertEquals("Width", "305", imageTag.getAttribute("width"));
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.