Package com.volantis.mcs.dom

Examples of com.volantis.mcs.dom.Document


                        "textE" +
                    "</i>" +
                "</b>";

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

        Element italics = (Element)dom.getRootElement().getHead();
        Element atomicElement = (Element)italics.getHead().getNext();
        visitor.pushCounterpartElementDown(atomicElement, "b");

        String actual = DOMUtilities.toString(dom, encoder);
View Full Code Here


                          String input,
                          String expected)
            throws Exception {

        XMLReader reader = DOMUtilities.getReader();
        Document dom = DOMUtilities.read(reader, input);
        new StyleRenamerTreeVisitor().visit(dom.getRootElement());

        StyleEmulationVisitor visitor = createStyleVisitor();
        visitor.transform(dom);

        String actual = DOMUtilities.toString(dom, encoder);
        assertEquals("Transformed result should match: " +
                "\nEXPECTED: " + expected +
                "\nACTUAL  : " + actual + "\n",
                expected,
                actual);

        // Visit all the nodes and examine how many time each node has been
        // processed.
        VisitationCheckerDOMVisitor visitationChecker =
                new VisitationCheckerDOMVisitor();

        dom.forEachChild(visitationChecker);

      //  System.out.println((DOMUtilities.toString(dom.getContentRoot(),
     //           protocol)));

        // TODO: we have had bugs where nodes were not visited, so fix this
View Full Code Here

                                                      Element element,
                                                      boolean recursive)
            throws Exception {

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

        Element root = dom.getRootElement();

        StyleEmulationVisitor visitor = createStyleVisitor();
        visitor.pushElementDownToAllChildren(element, root.getHead(),
            recursive, null);
View Full Code Here

        "<threeTwoOne/>" +
        "<threeThree/>" +
    "</three>" +
"</body>";

        Document document = StyledDOMTester.createStyledDom(inputXML);
        Element body = document.getRootElement();
        Element two = (Element)body.getHead().getNext();
        two.setName(null);
        ((Element)two.getTail()).setName(null);
        Element three = (Element)two.getNext();
        final Element threeOne = ((Element)three.getHead());
View Full Code Here

        extends TestCaseAbstract {

    public void testXFTextMUSelectRows() throws Exception {

        StrictStyledDOMHelper helper = new StrictStyledDOMHelper();
        Document document = helper.parse("<xfmuselect/>");
        Element root = document.getRootElement();
        StyleValue rows = root.getStyles().getPropertyValues()
                .getStyleValue(StylePropertyDetails.MCS_ROWS);
        assertEquals(StyleValueFactory.getDefaultInstance().getInteger(null, 4),
                rows);
    }
View Full Code Here

        ProtocolFactory factory = new ProtocolRegistry.HTMLVersion4_0Factory();
        ProtocolBuilder builder = new ProtocolBuilder();

        DOMProtocol protocol = (DOMProtocol)builder.build(factory, null);

        Document document = domFactory.createDocument();

        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

        ProtocolFactory factory = new ProtocolRegistry.HTMLVersion4_0Factory();
        ProtocolBuilder builder = new ProtocolBuilder();

        DOMProtocol protocol = (DOMProtocol)builder.build(factory, null);

        Document document = domFactory.createDocument();

        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

        ProtocolFactory factory = new ProtocolRegistry.HTMLVersion4_0Factory();
        ProtocolBuilder builder = new ProtocolBuilder();

        DOMProtocol protocol = (DOMProtocol)builder.build(factory, null);

        Document document = domFactory.createDocument();

        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

        ProtocolFactory factory = new ProtocolRegistry.HTMLVersion4_0Factory();
        ProtocolBuilder builder = new ProtocolBuilder();

        DOMProtocol protocol = (DOMProtocol)builder.build(factory, null);

        Document document = domFactory.createDocument();

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

        document.addNode(element1);

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

     * Parse the input and compare the result with the expected value.
     * @param input
     * @param expected
     */
    private void doTestStyleParsing(String input, String expected) {
        Document document = strictStyledDOMHelper.parse(input);

        String result = strictStyledDOMHelper.render(document);

        assertEquals("Unexpected Result", expected,  result);
    }
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.