Package com.volantis.mcs.dom

Examples of com.volantis.mcs.dom.Document.addNode()


        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


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

        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

     * @return a string representation of the DOMOutputBuffer
     */
    protected String bufferToString(DOMOutputBuffer buffer) {
        String result = null;
        Document doc = domFactory.createDocument();
        doc.addNode(buffer.getRoot());
        try {
            result = DOMUtilities.toString(doc, protocol.getCharacterEncoder());
            //System.out.println("buffer = " + result);
        } catch (Exception e) {
            // @todo change this to throw Exception and change all it's clients
View Full Code Here

        String result;
        final Document doc = domFactory.createDocument();
        NodeSequence contents = buffer.removeContents();
        contents.forEach(new NodeIteratee() {
            public IterationAction next(Node node) {
                doc.addNode(node);
                return IterationAction.CONTINUE;
            }
        });

        result = helper.render(doc);
View Full Code Here

            result += "<element>";
            Document doc = domFactory.createDocument();
            Element element = domFactory.createElement();
            element.copy(original);
            original.addChildrenToTail(element);
            doc.addNode(element);
            result += DOMUtilities.toString(
                    doc, protocol.getCharacterEncoder()) + "</element>\n";
            element.addChildrenToTail(original);
        } else {
            result += "<element/>\n";
View Full Code Here

    /**
     * Convenience method for converting DOMOutputBuffer to string
     */
    protected String domToString(DOMOutputBuffer dom) throws IOException {
        Document doc = domFactory.createDocument();
        doc.addNode(dom.getRoot());
        return DOMUtilities.toString(doc, protocol.getCharacterEncoder());
    }
}
View Full Code Here

        Element element1 = domFactory.createElement();
        element1.setName("h1");
        element1.setAttribute("href", "http://www.volantis.com/target.html");
        element1.setStyles(StylesBuilder.getInitialValueStyles());

        document.addNode(element1);

        HrefTransformer transfromer = new HrefTransformer();

        document = transfromer.transform(protocol, document);
View Full Code Here

        Element element1 = domFactory.createElement();
        element1.setName("span");
        element1.setStyles(StylesBuilder.getInitialValueStyles());

        document.addNode(element1);

        Element element2 = domFactory.createElement();
        element2.setName("code");
        element2.setStyles(StylesBuilder.getInitialValueStyles());
        element2.setAttribute("href", "http://www.volantis.com/target.html");
View Full Code Here

        Element element1 = domFactory.createElement();
        element1.setName("tr");
        element1.setStyles(StylesBuilder.getInitialValueStyles());
        element1.setAttribute("href", "http://www.volantis.com/target.html");

        document.addNode(element1);

        Element element2 = domFactory.createElement();
        element2.setName("ul");
        element2.setStyles(StylesBuilder.getInitialValueStyles());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.