Package com.volantis.mcs.dom

Examples of com.volantis.mcs.dom.Element


                  "</form>" +
                "</body>";

        Document dom = getStrictStyledDOMHelper().parse(input);

        Element body = dom.getRootElement();
        Element form = getChild(body);
        Element div11 = getChild(form);
        Element div22 = (Element) getChild(div11).getNext().getNext().getNext();
        Element div23 = (Element) div22.getNext();

        MyXHTMLBasicTransformer transformer = new MyXHTMLBasicTransformer();
        transformer.initialize(createProtocol());

        final Element inputControl = ((Element) div22.getPrevious()
                .getPrevious());
        assertEquals("Check we have got the right element from the DOM",
                "input", inputControl.getName());
        assertEquals("Check that it is the second input control",
                "expiredSessionUrl",
                inputControl.getAttributeValue("name"));

        assertTrue("There are no styles preventing this " +
                "Element from being removed.",
                transformer.treeVisitor.isDivEligibleForRemoval(div22));
        assertTrue("There are no styles preventing this " +
View Full Code Here


         *   </card>
         * <wml>
         */

        Document document = domFactory.createDocument();
        Element wml = domFactory.createElement();
        Element card = domFactory.createElement();
        Element dissectable = domFactory.createElement();
        Element dividehint = domFactory.createElement();
        Element p = domFactory.createElement();
        Text text = domFactory.createText();
       
        wml.setName("wml");
        card.setName("card");
        dissectable.setName(DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT);
        dividehint.setName(DissectionConstants.DIVIDE_HINT_ELEMENT);
        p.setName("BLOCK");
        text.append("some content");
       
        document.addNode(wml);
        wml.addTail(card);
        card.addTail(dissectable);       
        dissectable.addTail(dividehint);
        dissectable.addTail(p);
        p.addTail(text);
       
        String expected =
            "<wml>" +
              "<card>"+
                "<"+DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT+">" +
View Full Code Here

         *   </card>
         * <wml>
         */

        Document document = domFactory.createDocument();
        Element wml = domFactory.createElement();
        Element card = domFactory.createElement();
        Element p1 = domFactory.createElement();
        Element dissectable = domFactory.createElement();
        Element dividehint = domFactory.createElement();
        Text zero = domFactory.createText();
        Element p2 = domFactory.createElement();
        Text text = domFactory.createText();
       
        wml.setName("wml");
        card.setName("card");
        p1.setName("BLOCK");
        dissectable.setName(DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT);
        dividehint.setName(DissectionConstants.DIVIDE_HINT_ELEMENT);
        zero.append("");
        p2.setName("BLOCK");
        text.append("some content");
       
        document.addNode(wml);
        wml.addTail(card);
        card.addTail(p1);
        p1.addTail(dissectable);       
        dissectable.addTail(dividehint);
        dissectable.addTail(zero);
        dissectable.addTail(p2);
        p2.addTail(text);
       
        String expected =
            "<wml>" +
              "<card>"+
                "<"+DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT+">" +
View Full Code Here

         * <wml>
         * As there isn't a node following the DIVIDE-HINT we omit it.
         */

        Document document = domFactory.createDocument();
        Element wml = domFactory.createElement();
        Element card = domFactory.createElement();
        Element p1 = domFactory.createElement();
        Element dissectable = domFactory.createElement();
        Element p2 = domFactory.createElement();
        Text text = domFactory.createText();
        Element dividehint = domFactory.createElement();
        Text zero = domFactory.createText();
       
        wml.setName("wml");
        card.setName("card");
        p1.setName("BLOCK");
        dissectable.setName(DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT);
        p2.setName("BLOCK");
        text.append("some content");
        dividehint.setName(DissectionConstants.DIVIDE_HINT_ELEMENT);
        zero.append("");
       
        document.addNode(wml);
        wml.addTail(card);
        card.addTail(p1);
View Full Code Here

         *   </card>
         * <wml>
         */

        Document document = domFactory.createDocument();
        Element wml = domFactory.createElement();
        Element card = domFactory.createElement();
        Element p1 = domFactory.createElement();
        Element dissectable = domFactory.createElement();
        Element dividehint1 = domFactory.createElement();
        Text zero1 = domFactory.createText();
        Element dividehint2 = domFactory.createElement();
        Text zero2 = domFactory.createText();
        Element p2 = domFactory.createElement();
        Text text = domFactory.createText();
       
        wml.setName("wml");
        card.setName("card");
        p1.setName("BLOCK");
        dissectable.setName(DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT);
        dividehint1.setName(DissectionConstants.DIVIDE_HINT_ELEMENT);
        zero1.append("");
        dividehint2.setName(DissectionConstants.DIVIDE_HINT_ELEMENT);
        zero2.append("");
        p2.setName("BLOCK");
        text.append("some content");
       
        document.addNode(wml);
        wml.addTail(card);
        card.addTail(p1);
        p1.addTail(dissectable);       
        dissectable.addTail(dividehint1);
        dissectable.addTail(zero1);       
        dissectable.addTail(dividehint2);
        dissectable.addTail(zero2);       
        dissectable.addTail(p2);
        p2.addTail(text);       
       
        String expected =
            "<wml>" +
              "<card>"+
                "<"+DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT+">" +
View Full Code Here

         *   </card>
         * <wml>
         */

        Document document = domFactory.createDocument();
        Element wml = domFactory.createElement();
        Element card = domFactory.createElement();
        Element p1 = domFactory.createElement();
        Element dissectable = domFactory.createElement();
        Element p2 = domFactory.createElement();
        Element keeptogether1 = domFactory.createElement();
        Element p3 = domFactory.createElement();
        Element keeptogether2 = domFactory.createElement();
        Element p4 = domFactory.createElement();
        Text text = domFactory.createText();
       
        wml.setName("wml");
        card.setName("card");
        p1.setName("BLOCK");
        dissectable.setName(DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT);
        p2.setName("BLOCK");
        keeptogether1.setName(DissectionConstants.KEEPTOGETHER_ELEMENT);
        p3.setName("BLOCK");
        keeptogether2.setName(DissectionConstants.DIVIDE_HINT_ELEMENT);
        p4.setName("BLOCK");
        text.append("some content");
       
        document.addNode(wml);
        wml.addTail(card);
        card.addTail(p1);
        p1.addTail(dissectable);
        dissectable.addTail(p2);
        p2.addTail(keeptogether1);
        keeptogether1.addTail(p3);       
        p3.addTail(keeptogether2);
        keeptogether2.addTail(p4);       
        p4.addTail(text);       
       
        String expected =
            "<wml>" +
              "<card>"+
                "<"+DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT+">" +
View Full Code Here

         *   </card>
         * <wml>
         */

        Document document = domFactory.createDocument();
        Element wml = domFactory.createElement();
        Element card = domFactory.createElement();
        Element p1 = domFactory.createElement();
        Element dissectable = domFactory.createElement();
        Element p2 = domFactory.createElement();
        Text text = domFactory.createText();
        Element shardLinkGroup = domFactory.createElement();
        Element p3 = domFactory.createElement();
        Element shardLink1 = domFactory.createElement();
        Element a1 = domFactory.createElement();
        Text link1 = domFactory.createText();
        Element shardLinkConditional = domFactory.createElement();
        Element br = domFactory.createElement();
        Element shardLink2 = domFactory.createElement();
        Element a2 = domFactory.createElement();
        Text link2 = domFactory.createText();
               
        wml.setName("wml");
        card.setName("card");
        p1.setName("BLOCK");
        dissectable.setName(DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT);
        p2.setName("BLOCK");
        text.append("some content");
        shardLinkGroup.setName(DissectionConstants.SHARD_LINK_GROUP_ELEMENT);
        p3.setName("BLOCK");
        p3.setAttribute("mode", "wrap");               
        shardLink1.setName(DissectionConstants.SHARD_LINK_ELEMENT);
        a1.setName("a");
        a1.setAttribute("href", "url1");
        a1.addTail(link1);
        link1.append("link1");
        shardLinkConditional.setName(
            DissectionConstants.SHARD_LINK_CONDITIONAL_ELEMENT);
        br.setName("br");                            
        shardLink2.setName(DissectionConstants.SHARD_LINK_ELEMENT);
        a2.setName("a");
        a2.setAttribute("href", "url2");
        a2.addTail(link2);
        link2.append("link2");
     
        document.addNode(wml);
        wml.addTail(card);
        card.addTail(p1);
View Full Code Here

        assertEquals("Shard Link Group not on same level as dissecting pane",
                     expected, domAsString);       
    }

    public void testAddBlocks() throws Exception {
        Element card = domFactory.createElement();
        Element p = domFactory.createElement();
        Element timer = domFactory.createElement();
        Element onevent = domFactory.createElement();
        Element pre = domFactory.createElement();
        Element _do = domFactory.createElement();
        Element table = domFactory.createElement();
        boolean result;
        Node child;
        int count = 0;
        String[] expected = {"BLOCK", "timer", "onevent", "do", "BLOCK"};
        List actual = new ArrayList();

        card.setName("card");
        p.setName("BLOCK");
        timer.setName("timer");
        onevent.setName("onevent");
        pre.setName("pre");
        _do.setName("do");
        table.setName("table");

        card.addTail(p);
        card.addTail(timer);
        card.addTail(onevent);
        card.addTail(_do);
View Full Code Here

        DOMProtocol protocol = createProtocol();

        transformer.initialize(protocol);

        assertTrue(transformer.matches(node, null) == false);
        Element element = domFactory.createElement();
        element.setName("div");
        assertTrue(transformer.matches(element, "div"));

        element.setName("");
        assertTrue(transformer.matches(element, ""));

        element.setName(null);
        assertTrue(transformer.matches(element, "div") == false);
        assertTrue(transformer.matches(element, "") == false);
        try {
            assertTrue(transformer.matches(element, null));
            fail ("Should throw null pointer exception.");
        } catch (NullPointerException e) {
        }

        // Mis-matching names and case-sensitivity.
        element.setName("Name mismatch test");
        assertTrue(transformer.matches(element, "div") == false);
        assertTrue(transformer.matches(element, "name mismatch test") == false);
        assertTrue(transformer.matches(element, "Name mismatch test"));
    }
View Full Code Here

        protocol.openPane(buffer, paneAttrs);

        buffer.closeElement("td");
        buffer.closeElement("tr");
        Element table = buffer.closeElement("table");
        checkTableAttributes(table);
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.dom.Element

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.