Package org.htmlparser

Examples of org.htmlparser.Tag


        // loop inside the tags of the same type
        NodeList links = getLinks (input, filter, recursive);
        for (int j=0; j<links.size(); j++)
        {
            CompositeTag beginTag = (CompositeTag)links.elementAt(j);
            Tag endTag = beginTag.getEndTag();

            // positions of begin and end tags
            int beginTagBegin = beginTag.getStartPosition ();
            int endTagBegin = beginTag.getEndPosition ();
            int beginTagEnd = endTag.getStartPosition ();
            int endTagEnd = endTag.getEndPosition ();

            if (insideTag)
            {
                dummyString = modifyDummyString (new String(dummyString), beginTagBegin, endTagEnd);
            }
View Full Code Here


        if (!recursive)
        {
            for (int j=0; j<links.size(); j++)
            {
                CompositeTag jStartTag = (CompositeTag)links.elementAt(j);
                Tag jEndTag = jStartTag.getEndTag();
                int jStartTagBegin = jStartTag.getStartPosition ();
                int jEndTagEnd = jEndTag.getEndPosition ();
                for (int k=0; k<links.size(); k++)
                {
                    CompositeTag kStartTag = (CompositeTag)links.elementAt(k);
                    Tag kEndTag = kStartTag.getEndTag();
                    int kStartTagBegin = kStartTag.getStartPosition ();
                    int kEndTagEnd = kEndTag.getEndPosition ();
                    if ((k!=j) && (kStartTagBegin>jStartTagBegin) && (kEndTagEnd<jEndTagEnd))
                    {
                        links.remove(k);
                        k--;
                        j--;
View Full Code Here

        if (!recursive)
        {
            for (int j=0; j<links.size(); j++)
            {
                CompositeTag jStartTag = (CompositeTag)links.elementAt(j);
                Tag jEndTag = jStartTag.getEndTag();
                int jStartTagBegin = jStartTag.getStartPosition ();
                int jEndTagEnd = jEndTag.getEndPosition ();
                for (int k=0; k<links.size(); k++)
                {
                    CompositeTag kStartTag = (CompositeTag)links.elementAt(k);
                    Tag kEndTag = kStartTag.getEndTag();
                    int kStartTagBegin = kStartTag.getStartPosition ();
                    int kEndTagEnd = kEndTag.getEndPosition ();
                    if ((k!=j) && (kStartTagBegin>jStartTagBegin) && (kEndTagEnd<jEndTagEnd))
                    {
                        links.remove(k);
                        k--;
                        j--;
View Full Code Here

        JspTag tag = (JspTag)node[0];
        assertStringEquals("Contents of the tag","%@ taglib uri=\"/WEB-INF/struts.tld\" prefix=\"struts\" %",tag.getText());

        // The second node should be a normal tag
        assertTrue("Node 3 should be a normal Tag",node[2] instanceof Tag);
        Tag htag = (Tag)node[2];
        assertStringEquals("Contents of the tag",contents,htag.getText());
        assertStringEquals("html",jsp,htag.toHtml());
        // The third node should be an JspTag
        assertTrue("Node 5 should be an JspTag",node[4] instanceof JspTag);
        JspTag tag2 = (JspTag)node[4];
        assertStringEquals("Contents of the tag",contents2,tag2.getText());
    }
View Full Code Here

     */
    public Hashtable createAppletParamsTable ()
    {
        NodeList kids;
        Node node;
        Tag tag;
        String paramName;
        String paramValue;
        Hashtable ret;

        ret = new Hashtable ();
        kids = getChildren ();
        if (null != kids)
            for (int i = 0; i < kids.size (); i++)
            {
                node = children.elementAt(i);
                if (node instanceof Tag)
                {
                    tag = (Tag)node;
                    if (tag.getTagName().equals ("PARAM"))
                    {
                        paramName = tag.getAttribute ("NAME");
                        if (null != paramName && 0 != paramName.length ())
                        {
                            paramValue = tag.getAttribute ("VALUE");
                            ret.put (paramName,paramValue);
                        }
                    }
                }
            }
View Full Code Here

     */
    public void setAppletParams (Hashtable newAppletParams)
    {
        NodeList kids;
        Node node;
        Tag tag;
        String paramName;
        String paramValue;
        Vector attributes;
        Text string;

View Full Code Here

     */
    public Hashtable createObjectParamsTable ()
    {
        NodeList kids;
        Node node;
        Tag tag;
        String paramName;
        String paramValue;
        Hashtable ret;

        ret = new Hashtable ();
        kids = getChildren ();
        if (null != kids)
            for (int i = 0; i < kids.size (); i++)
            {
                node = children.elementAt(i);
                if (node instanceof Tag)
                {
                    tag = (Tag)node;
                    if (tag.getTagName().equals ("PARAM"))
                    {
                        paramName = tag.getAttribute ("NAME");
                        if (null != paramName && 0 != paramName.length ())
                        {
                            paramValue = tag.getAttribute ("VALUE");
                            ret.put (paramName.toUpperCase(),paramValue);
                        }
                    }
                }
            }
View Full Code Here

     */
    public void setObjectParams (Hashtable newObjectParams)
    {
        NodeList kids;
        Node node;
        Tag tag;
        String paramName;
        String paramValue;
        Vector attributes;
        TextNode string;
       
View Full Code Here

        assertEquals ("only one element", 1, list.size ());
        assertType ("should be LinkTag", LinkTag.class, list.elementAt (0));
        LinkTag link = (LinkTag)list.elementAt (0);
        assertEquals ("three children", 3, link.getChildCount ());
        assertSuperType ("should be TagNode", Tag.class, link.getChildren ().elementAt (0));
        Tag tag = (Tag)link.getChildren ().elementAt (0);
        assertStringEquals("name", "B", tag.getTagName ());
    }
View Full Code Here

        assertStringEquals(
            "second custom tag html",
            tag2,
            customTag.toHtml()
        );
        Tag endTag = (Tag)node[2];
        assertStringEquals(
            "third custom tag html",
            tag3,
            endTag.toHtml()
        );
    }
View Full Code Here

TOP

Related Classes of org.htmlparser.Tag

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.