Package org.htmlparser.tags

Examples of org.htmlparser.tags.ScriptTag


    {
        StringNode stringNode =
            new StringNode(new StringBuffer("Script Code"), 0, 0);
        NodeList childVector = new NodeList();
        childVector.add(stringNode);
        ScriptTag scriptTag =
            new ScriptTag(
                new TagData(0, 10, "Tag Contents", "tagline"),
                new CompositeTagData(null, null, childVector));

        assertNotNull("Script Tag object creation", scriptTag);
        assertEquals("Script Tag Begin", 0, scriptTag.elementBegin());
        assertEquals("Script Tag End", 10, scriptTag.elementEnd());
        assertEquals(
            "Script Tag Contents",
            "Tag Contents",
            scriptTag.getText());
        assertEquals(
            "Script Tag Code",
            "Script Code",
            scriptTag.getScriptCode());
        assertEquals("Script Tag Line", "tagline", scriptTag.getTagLine());
    }
View Full Code Here


        parser.addScanner(new ScriptScanner("-s"));

        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());
    }
View Full Code Here

        String expectedHTML = new String(sb2.toString());

        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());
    }
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];
        assertEquals("Script Src", "/adb.js", scriptTag.getAttribute("src"));
        assertEquals(
            "Script Language",
            "javascript",
            scriptTag.getAttribute("language"));
    }
View Full Code Here

        // Register the image scanner
        parser.addScanner(new ScriptScanner("-s"));
        //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());
    }
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

        // Register the script scanner
        parser.addScanner(new ScriptScanner("-s"));
        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];
        assertStringEquals(
            "Expected Script Code",
            "document.write(d+\".com\")",
            scriptTag.getScriptCode());
        assertStringEquals("script tag html", testHtml, scriptTag.toHtml());
    }
View Full Code Here

        return MATCH_NAME;
    }

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

          if (link.getChild(0) instanceof ImageTag){
            ImageTag img = (ImageTag)link.getChild(0);
            binUrlStr = img.getImageURL();
          }
        } else if (node instanceof ScriptTag){
          ScriptTag script = (ScriptTag)node;
          binUrlStr = script.getAttribute("src");
        } else if (node instanceof FrameTag){
          FrameTag tag = (FrameTag)node;
          binUrlStr = tag.getAttribute("src");
        } else if (node instanceof LinkTagTag){
          LinkTagTag script = (LinkTagTag)node;
          if (script.getAttribute("rel").equalsIgnoreCase("stylesheet")){
            binUrlStr = script.getAttribute("href");
          }
        }
       
                if (binUrlStr == null)
                {
View Full Code Here

        registerTag (new MetaTag ());
        registerTag (new ObjectTag ());
        registerTag (new OptionTag ());
        registerTag (new ParagraphTag ());
        registerTag (new ProcessingInstructionTag ());
        registerTag (new ScriptTag ());
        registerTag (new SelectTag ());
        registerTag (new StyleTag ());
        registerTag (new TableColumn ());
        registerTag (new TableHeader ());
        registerTag (new TableRow ());
View Full Code Here

TOP

Related Classes of org.htmlparser.tags.ScriptTag

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.