Package org.htmlparser.tags.data

Examples of org.htmlparser.tags.data.TagData


    public void testTypeFtp() throws ParserException
    {
        LinkTag linkTag =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData("ftp://www.someurl.com", "", "", false, false));
        assertTrue("This is an ftp link", linkTag.isFTPLink());
    }
View Full Code Here


    public void testTypeJavaScript() throws ParserException
    {
        LinkTag linkTag =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData(
                    "javascript://www.someurl.com",
                    "",
                    "",
View Full Code Here

    public void testTypeHttpLink() throws ParserException
    {
        LinkTag linkTag =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData("http://www.someurl.com", "", "", false, false));
        assertTrue(
            "This is a http link : " + linkTag.getLink(),
            linkTag.isHTTPLink());
        linkTag =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData("somePage.html", "", "", false, false));
        assertTrue(
            "This relative link is alsp a http link : " + linkTag.getLink(),
            linkTag.isHTTPLink());
        linkTag =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData("ftp://somePage.html", "", "", false, false));
        assertTrue(
            "This is not a http link : " + linkTag.getLink(),
            !linkTag.isHTTPLink());
View Full Code Here

    public void testTypeHttpLikeLink() throws ParserException
    {
        LinkTag linkTag =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData("http://", "", "", false, false));
        assertTrue("This is a http link", linkTag.isHTTPLikeLink());
        LinkTag linkTag2 =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData("https://www.someurl.com", "", "", false, false));
        assertTrue("This is a https link", linkTag2.isHTTPLikeLink());
    }
View Full Code Here

     */
    public void testExtractImageLocnInvertedCommasBug() throws ParserException
    {
        Tag tag =
            new Tag(
                new TagData(
                    0,
                    0,
                    "img width=638 height=53 border=0 usemap=\"#m\" src=http://us.a1.yimg.com/us.yimg.com/i/ww/m5v5.gif alt=Yahoo",
                    ""));
        String link =
View Full Code Here

    }

    public void testConstruction()
    {
        BaseHrefTag baseRefTag =
            new BaseHrefTag(new TagData(0, 0, "", ""), "http://www.abc.com");
        assertEquals(
            "Expected Base URL",
            "http://www.abc.com",
            baseRefTag.getBaseUrl());
    }
View Full Code Here

            new CompositeTagScannerHelper(null, null, null, null, null, false);
    }

    public void testIsXmlEndTagForRealXml()
    {
        Tag tag = new Tag(new TagData(0, 0, "something/", ""));
        assertTrue("should be an xml end tag", helper.isXmlEndTag(tag));
    }
View Full Code Here

        assertTrue("should be an xml end tag", helper.isXmlEndTag(tag));
    }

    public void testIsXmlEndTagForFalseMatches()
    {
        Tag tag = new Tag(new TagData(0, 0, "a href=http://someurl.com/", ""));
        assertFalse("should not be an xml end tag", helper.isXmlEndTag(tag));
    }
View Full Code Here

     */
    public Tag scan(Tag tag, String url, NodeReader reader, String currLine)
        throws ParserException
    {
        return createTag(
            new TagData(
                tag.elementBegin(),
                tag.elementEnd(),
                tag.getText(),
                currLine),
            tag,
View Full Code Here

    {
        // Replace tag - it was a <A> tag - replace with </a>
        String newLine = replaceFaultyTagWithEndTag(tag, currentLine);
        reader.changeLine(newLine);
        return new EndTag(
            new TagData(
                tag.elementBegin(),
                tag.elementBegin() + 3,
                tag.getTagName(),
                currentLine));
    }
View Full Code Here

TOP

Related Classes of org.htmlparser.tags.data.TagData

Copyright © 2018 www.massapicom. 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.