Examples of StyleTag


Examples of org.htmlparser.tags.StyleTag

        "-->"+
        "</STYLE>";
        createParser(style);
        parseAndAssertNodeCount(1);
        assertTrue(node[0] instanceof StyleTag);
        StyleTag styleTag = (StyleTag)node[0];
        assertStringEquals("toHtml",style,styleTag.toHtml());
    }
View Full Code Here

Examples of org.htmlparser.tags.StyleTag

        assertTrue("HTML tag should have one child", 1 == html.getChildCount ());
        assertTrue("First child should be a HEAD tag", html.childAt (0) instanceof HeadTag);
        HeadTag head = (HeadTag)html.childAt (0);
        assertTrue("HEAD tag should have four children", 4 == head.getChildCount ());
        assertTrue("Fourth child should be a STYLE tag", head.childAt (3) instanceof StyleTag);
        StyleTag styleTag = (StyleTag)head.childAt (3);
        assertEquals("Style Code","a.h{background-color:#ffee99}",styleTag.getStyleCode());
    }
View Full Code Here

Examples of org.htmlparser.tags.StyleTag

        assertTrue("HTML tag should have one child", 1 == html.getChildCount ());
        assertTrue("First child should be a HEAD tag", html.childAt (0) instanceof HeadTag);
        HeadTag head = (HeadTag)html.childAt (0);
        assertTrue("HEAD tag should have three children", 3 == head.getChildCount ());
        assertTrue("Third child should be a STYLE tag", head.childAt (2) instanceof StyleTag);
        StyleTag styleTag = (StyleTag)head.childAt (2);
        assertStringEquals("Expected Style Code",expectedCode,styleTag.getStyleCode());
    }
View Full Code Here

Examples of org.htmlparser.tags.StyleTag

            "-->";
        String html =
            "<style type=\"text/css\" media=\"screen\">" +
            style +
            "</style>";
        StyleTag tag;
        Text string;

        createParser (html);
        parseAndAssertNodeCount (1);
        assertTrue ("Node should be a STYLE tag", node[0] instanceof StyleTag);
        tag = (StyleTag)node[0];
        assertTrue ("STYLE tag should have one child", 1 == tag.getChildCount ());
        assertTrue ("Child should be a StringNode", tag.getChild (0) instanceof Text);
        string = (Text)tag.getChild (0);
        assertStringEquals ("Style text incorrect", style, string.toHtml ());
    }
View Full Code Here

Examples of org.htmlparser.tags.StyleTag

  public void testToHTML() throws ParserException {
    createParser("<style>a.h{background-color:#ffee99}</style>");
    parser.registerScanners();
    parseAndAssertNodeCount(1);
    assertTrue(node[0] instanceof StyleTag);
    StyleTag styleTag = (StyleTag) node[0];
    assertEquals("Raw String", "<STYLE>a.h{background-color:#ffee99}</STYLE>", styleTag.toHtml());
  }
View Full Code Here

Examples of org.htmlparser.tags.StyleTag

    Parser.setLineSeparator("\r\n");
    parser.registerScanners();
    parseAndAssertNodeCount(1);
    assertTrue(node[0] instanceof StyleTag);
    StyleTag styleTag = (StyleTag) node[0];
    assertStringEquals("Raw String", "<STYLE TYPE=\"text/css\">\r\n" + "<!--" + "{something....something}" + "-->"
        + "</STYLE>", styleTag.toHtml());
  }
View Full Code Here

Examples of org.htmlparser.tags.StyleTag

  public String[] getID() {
    return MATCH_NAME;
  }

  public Tag createTag(TagData tagData, CompositeTagData compositeTagData) {
    return new StyleTag(tagData, compositeTagData);
  }
View Full Code Here

Examples of org.htmlparser.tags.StyleTag

        "<html><head><title>Yahoo!</title><base href=http://www.yahoo.com/ target=_top><meta http-equiv=\"PICS-Label\" content='(PICS-1.1 \"http://www.icra.org/ratingsv02.html\" l r (cz 1 lz 1 nz 1 oz 1 vz 1) gen true for \"http://www.yahoo.com\" r (cz 1 lz 1 nz 1 oz 1 vz 1) \"http://www.rsac.org/ratingsv01.html\" l r (n 0 s 0 v 0 l 0) gen true for \"http://www.yahoo.com\" r (n 0 s 0 v 0 l 0))'><style>a.h{background-color:#ffee99}</style></head>",
        "http://www.google.com/test/index.html");
    parser.registerScanners();
    parseAndAssertNodeCount(7);
    assertTrue("Second last node should be a style tag", node[5] instanceof StyleTag);
    StyleTag styleTag = (StyleTag) node[5];
    assertEquals("Style Code", "a.h{background-color:#ffee99}", styleTag.getStyleCode());
  }
View Full Code Here

Examples of org.htmlparser.tags.StyleTag

            + "body,td,a,p,.h{font-family:arial,sans-serif;} .h{font-size: 20px;} .h{color:} .q{text-decoration:none; color:#0000cc;}\n"
            + "//--></style>", "http://www.yle.fi/");
    parser.registerScanners();
    parseAndAssertNodeCount(5);
    assertTrue(node[4] instanceof StyleTag);
    StyleTag styleTag = (StyleTag) node[4];
    String expectedCode = "<!--\r\n"
        + "body,td,a,p,.h{font-family:arial,sans-serif;} .h{font-size: 20px;} .h{color:} .q{text-decoration:none; color:#0000cc;}\r\n"
        + "//-->";
    assertStringEquals("Expected Style Code", expectedCode, styleTag.getStyleCode());
  }
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.