Package com.volantis.mcs.dom

Examples of com.volantis.mcs.dom.Document


                      "<div>Lots of text here, which is effectively a 'paragraph'</div>"   +
                    "</div>" +
                  "</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();
View Full Code Here


     *
     * @param input
     * @param expected
     */
    private void doVisitorTest(String input, String expected) {
        Document dom = getStrictStyledDOMHelper().parse(input);

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

        transformer.treeVisitor.visit(dom);
View Full Code Here

                "level 1 " +
                "</prompt>" +
                "</form>";

        XMLReader reader = DOMUtilities.getReader();
        Document dom = DOMUtilities.read(reader, domString);

        VoiceXMLTransformer transformer = new VoiceXMLTransformer();

        VoiceXMLVersion1_0 protocol = createProtocol();
View Full Code Here

                "end of choice " +
                "</choice>" +
                "</form>";

        XMLReader reader = DOMUtilities.getReader();
        Document dom = DOMUtilities.read(reader, domString);

        VoiceXMLTransformer transformer = new VoiceXMLTransformer();

        VoiceXMLVersion1_0 protocol = createProtocol();
View Full Code Here

                "</menu>" +
                "</form>" +
                "</xml>";
       
        XMLReader reader = DOMUtilities.getReader();
        Document dom = DOMUtilities.read(reader, domString);
           
        VoiceXMLTransformer transformer = new VoiceXMLTransformer();
        transformer.transform(createProtocol(), dom);
       
        final Set ids = new HashSet();
       
        RecursingDOMVisitor visitor = new RecursingDOMVisitor() {

            public void visit(Element element) {
                if("menu".equals(element.getName())) {
                    String id = element.getAttributeValue("id");
                    assertNotNull("menu id should not be null", id);
                    assertTrue("Found non-unique id: " + id,
                               ids.add(id));
                }
                element.forEachChild(this);
            }
        };
        dom.forEachChild(visitor);   
    }
View Full Code Here

               "</prompt>" +
               "</form>" +
               "</xml>";        
                      
        XMLReader reader = DOMUtilities.getReader();
        Document dom = DOMUtilities.read(reader, domString);

        VoiceXMLTransformer transformer = new VoiceXMLTransformer();

        VoiceXMLVersion1_0 protocol = createProtocol();
View Full Code Here

               "</prompt>" +
               "</form>" +
               "</xml>";        
                      
        XMLReader reader = DOMUtilities.getReader();
        Document dom = DOMUtilities.read(reader, domString);

        VoiceXMLTransformer transformer = new VoiceXMLTransformer();

        VoiceXMLVersion1_0 protocol = createProtocol();
View Full Code Here

    private void doTransformTest(String original, String expected)
            throws Exception  {

        DOMProtocol protocol = createProtocol();

        Document originalDOM = helper.parse(original);
        Document expectedDOM = helper.parse(expected);

        XHTMLBasic_MIB2_1Transformer transformer =
                new XHTMLBasic_MIB2_1Transformer();

        Document transformedDOM = transformer.transform(protocol, originalDOM);

        // In actual operation this transformer would form a compound
        // transformer with the NullRemovingDOMTransformer.
        NullRemovingDOMTransformer nullRemover = new NullRemovingDOMTransformer();
        nullRemover.transform(null, transformedDOM);
View Full Code Here

        // select
        protocol.doSelectInput(attributes);

        // extract the result
        final Document document = domFactory.createDocument();
        Element root = buffer.getRoot();
        if (root.getName() == null) {
            root.setName("testRoot");
        }
        document.addNode(root);
        StyledDOMTester tester = new StyledDOMTester(true);
        final String result = tester.render(document);

        assertEquals(tester.normalize(getExpectedXFSelectString()), result);
    }
View Full Code Here

            expected;


        // The actual dom - constructed from the bufferRoot and wrapped in
        // 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");

        buffer.getRoot().addChildrenToHead(root);

        document.addNode(root);
        DOMTransformer domTransformer = protocol.getDOMTransformer();
        if (domTransformer != null) {
            document = domTransformer.transform(protocol, document);
        }
View Full Code Here

TOP

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

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.