Package com.volantis.mcs.dom

Examples of com.volantis.mcs.dom.Text


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


        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);
        p1.addTail(dissectable);
View Full Code Here

        Element root = buffer.getCurrentElement();
        Element span = (Element) root.getHead();

        DOMAssertionUtilities.assertElement("span", span);

        Text altText = (Text)span.getHead();
        String txtAltText = new String(altText.getContents(),
                0, expected.length());
        assertEquals("Incorrect Text", expected, txtAltText);
    }
View Full Code Here

    /**
     * Test the output of a variable
     *
     */
    public void testOutputTextNodeBracketedVariable() throws WBSAXException{
        Text textNode = domFactory.createText();
        textNode.append(WMLVariable.WMLV_BRACKETED + "var" +
        WMLVariable.WMLV_BRACKETED);
        textNode.accept(outputter);

        ArrayList parameterList;
        ArrayList events = enumeratedWBSAXContentHandler.getEvents();
        ArrayList parameters = enumeratedWBSAXContentHandler.getParameters();
        // Expecting:
View Full Code Here

    /**
     * Test the output of an escaped variable
     *
     */
    public void testOutputTextNodeEscapedVariable() throws WBSAXException{
        Text textNode = domFactory.createText();
        textNode.append(WMLVariable.WMLV_BRACKETED + "var" +
        WMLVariable.WMLV_ESCAPE);
        textNode.accept(outputter);

        ArrayList parameterList;
        ArrayList events = enumeratedWBSAXContentHandler.getEvents();
        ArrayList parameters = enumeratedWBSAXContentHandler.getParameters();
        // Expecting:
View Full Code Here

    /**
     * Test the output of an unescaped variable
     *
     */
    public void testOutputTextNodeUnEscapedVariable() throws WBSAXException{
        Text textNode = domFactory.createText();
        textNode.append(WMLVariable.WMLV_BRACKETED + "var" +
        WMLVariable.WMLV_UNESC);
        textNode.accept(outputter);

        ArrayList parameterList;
        ArrayList events = enumeratedWBSAXContentHandler.getEvents();
        ArrayList parameters = enumeratedWBSAXContentHandler.getParameters();
        // Expecting:
View Full Code Here

    /**
     * Test the output of an literal dollare
     *
     */
    public void testOutputTextNodeLiteralDollar() throws WBSAXException{
        Text textNode = domFactory.createText();
        textNode.append('$' + "text");
        textNode.accept(outputter);
   
        ArrayList parameterList;
        ArrayList events = enumeratedWBSAXContentHandler.getEvents();
        ArrayList parameters = enumeratedWBSAXContentHandler.getParameters();
        // Expecting:
View Full Code Here

        // an xml and form tag.
        Document document = domFactory.createDocument();


        // We require &nbsb; to be parse to place this doctype into the dom.
        Text node = domFactory.createText();
        node.setEncoded(true);
        node.append("<!DOCTYPE xml [ <!ENTITY nbsp \"&#160;\"> ]>");

        document.addNode(node);
        Element root = domFactory.createElement();
        root.setName("p");
View Full Code Here

     */
    protected static Text checkTextEquals(String expectedText,
                                          Node actualNode) {
        assertTrue("Node not a Text: " + actualNode.getClass().getName(),
                   actualNode instanceof Text);
        Text text = (Text)actualNode;
        assertEquals(expectedText,
                     new String(text.getContents(), 0, text.getLength()));
        return text;
    }
View Full Code Here

    /**
     * Checks the result of the pre test.
     * @param buffer the buffer that contains the result
     */
    protected void checkResultForPre(final DOMOutputBuffer buffer) {
        final Text beforeText = getContentHeadForPre(buffer);
        assertEquals("     before     ",
            new String(beforeText.getContents(), 0, beforeText.getLength()));
        final Element emElement = (Element) beforeText.getNext();
        final Text emText = (Text) emElement.getHead();
        assertEquals("     child     text     ",
            new String(emText.getContents(), 0, emText.getLength()));
        assertNull(emText.getNext());
        final Text afterText = (Text) emElement.getNext();
        assertEquals("     after     ",
            new String(afterText.getContents(), 0, afterText.getLength()));
    }
View Full Code Here

TOP

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

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.