Package org.htmlparser.tags

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


    parseAndAssertNodeCount(1);
    assertTrue("Node should be a script tag", node[0] instanceof ScriptTag);
    // Check the data in the applet tag
    ScriptTag scriptTag = (ScriptTag) node[0];
    assertEquals("Expected Raw String", "<SCRIPT>document.write(d+\".com\")</SCRIPT>", scriptTag.toHtml());
  }

  /**
   * Bug check by Wolfgang Germund 2002-06-02 Upon parsing : &lt;script
   * language="javascript"&gt; if(navigator.appName.indexOf("Netscape") != -1)
View Full Code Here


    parseAndAssertNodeCount(2);
    assertTrue("Node should be a script tag", node[1] instanceof ScriptTag);
    // Check the data in the applet tag
    ScriptTag scriptTag = (ScriptTag) node[1];
    assertStringEquals("Expected Script Code", expectedHTML, scriptTag.toHtml());
  }

  public void testParamExtraction() throws ParserException {
    StringBuffer sb1 = new StringBuffer();
    sb1.append("<script src=\"/adb.js\" language=\"javascript\">\r\n");
View Full Code Here

    // parser.registerScanners();
    parseAndAssertNodeCount(1);
    assertTrue("Node should be a script tag", node[0] instanceof ScriptTag);
    ScriptTag scriptTag = (ScriptTag) node[0];
    assertStringEquals("Script toHTML()",
        "<SCRIPT LANGUAGE=\"javascript\">\r\nvar lower = '<%=lowerValue%>';\r\n</SCRIPT>", scriptTag.toHtml());
  }

  public void testSingleApostropheParsingBug() throws ParserException {
    StringBuffer sb1 = new StringBuffer();
    sb1.append("<script src='<%=sourceFileName%>'></script>");
View Full Code Here

    // Register the image scanner
    parser.addScanner(new ScriptScanner("-s"));
    parseAndAssertNodeCount(1);
    assertTrue("Node should be a script tag", node[0] instanceof ScriptTag);
    ScriptTag scriptTag = (ScriptTag) node[0];
    assertStringEquals("Script toHTML()", "<SCRIPT SRC=\"<%=sourceFileName%>\"></SCRIPT>", scriptTag.toHtml());
  }

}
View Full Code Here

        createParser("<SCRIPT>document.write(d+\".com\")</SCRIPT>");
        parseAndAssertNodeCount(1);
        assertTrue("Node should be a script tag",node[0] instanceof ScriptTag);
        // Check the data in the applet tag
        ScriptTag scriptTag = (ScriptTag)node[0];
        assertEquals("Expected Raw String","<SCRIPT>document.write(d+\".com\")</SCRIPT>",scriptTag.toHtml());
    }

    /**
     * Test raw string.
     * Bug check by Wolfgang Germund 2002-06-02
View Full Code Here

        parseAndAssertNodeCount(3);
        assertTrue("Node should be a script tag",node[1]
        instanceof ScriptTag);
        // Check the data in the script tag
        ScriptTag scriptTag = (ScriptTag)node[1];
        assertStringEquals("Expected Script Code",expectedHTML,scriptTag.toHtml());
    }

    public void testParamExtraction() throws ParserException {
        StringBuffer sb1 = new StringBuffer();
        sb1.append("<script src=\"/adb.js\" language=\"javascript\">\r\n");
View Full Code Here

        sb1.append("</script>\n");
        createParser(sb1.toString());
        parseAndAssertNodeCount(2);
        assertTrue("Node should be a script tag",node[0] instanceof ScriptTag);
        ScriptTag scriptTag = (ScriptTag)node[0];
        assertStringEquals("Script toHTML()","<script language=\"javascript\">\nvar lower = '<%=lowerValue%>';\n</script>",scriptTag.toHtml());
    }

    public void testSingleApostropheParsingBug() throws ParserException {
        String script = "<script src='<%=sourceFileName%>'></script>";
        createParser(script);
View Full Code Here

        String script = "<script src='<%=sourceFileName%>'></script>";
        createParser(script);
        parseAndAssertNodeCount(1);
        assertTrue("Node should be a script tag",node[0] instanceof ScriptTag);
        ScriptTag scriptTag = (ScriptTag)node[0];
        assertStringEquals("Script toHTML()",script,scriptTag.toHtml());
    }

}
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.