Package com.volantis.mcs.dom

Examples of com.volantis.mcs.dom.Document


                "</tr>" +
              "</tbody>" +
            "</table>" +
            "</root>";

        Document dom = generateDOM(tableWithoutOneventCell);
        XHTMLBasicTransFactory transFactory =
                new XHTMLBasicTransFactory(configuration);

        assertTrue("tableWithoutOneventCell(cells) failed",
                   !helper.tableContains(dom.getRootElement(), transFactory,
                           "onevent", true));

        assertTrue("tableWithoutOneventCell(rows) failed",
                   !helper.tableContains(dom.getRootElement(), transFactory,
                           "onevent", false));

        dom = generateDOM(tableWithOneventCell);

        assertTrue("tableWithOneventCell(cells) failed",
                   helper.tableContains(dom.getRootElement(), transFactory,
                           "onevent", true));

        assertTrue("tableWithOneventCell(rows) failed",
                   !helper.tableContains(dom.getRootElement(), transFactory,
                           "onevent", false));

        dom = generateDOM(tableWithOneventRow);

        assertTrue("tableWithOneventRow(cells) failed",
                   helper.tableContains(dom.getRootElement(), transFactory,
                           "onevent", true));

        assertTrue("tableWithOneventRow(rows) failed",
                   helper.tableContains(dom.getRootElement(), transFactory,
                           "onevent", false));
    }
View Full Code Here


                   !helper.match(table1, table2, "cellspacing"));
    }

    protected Document generateDOM(String xml) throws Exception {
        XMLReader reader = DOMUtilities.getReader();
        Document dom = DOMUtilities.read(reader, xml);

        return dom;
    }
View Full Code Here

     * @throws Exception if there was a problem parsing the XML
     */
    protected void doTest(DOMProtocol protocol, String original,
            String expected) throws Exception {

        Document dom = helper.parse(original);
        Document expectedDom = helper.parse(expected);

        DOMTransformer transformer = getTransformer();

        transformer.transform(protocol, dom);

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

            throws SAXException, IOException {


        XMLReader reader = DOMUtilities.getReader();
        String normalized;
        Document document = DOMUtilities.read(reader, domString);
        normalized = DOMUtilities.toString(document, encoder);

        return normalized;
    }
View Full Code Here

            return domString;
        }
       
        XMLReader reader = DOMUtilities.getReader();
        String normalized;
        Document document;
        try {
            document = DOMUtilities.read(reader, domString);
        } catch (SAXException e) {
            throw new ExtendedSAXException("Unable to parse: " + domString, e);
        }
View Full Code Here

        XMLReader reader = getReader();

        reader.parse(source);

        Document document = ((MCSDOMContentHandler) reader.getContentHandler()).
                getDocument();
        Element root = document.getRootElement();
        if (!"root".equals(root.getName())) {
            throw new IllegalStateException("Root element name mismatch, " +
                    "expected 'root', actual '" + root.getName() + "'");
        }
View Full Code Here

    protected void doTest(DOMProtocol protocol,
                          String original,
                          String expected) throws Exception {

        Document dom = helper.parse(original);
        Document expectedDom = helper.parse(expected);
        String domAsString;
        String expectedAsString;
        DOMTransformer transformer = new HTML3_2UnabridgedTransformer(
                protocol.getProtocolConfiguration());
View Full Code Here

                    "</div>" +
                "</table>" +
                "</root>";

        try {
            Document dom = getStrictStyledDOMHelper().parse(domString);

            Element element = dom.getRootElement();
            dom.accept(new NullRemoverTreeVisitor());

            AbstractDivRemover divRemover = getDivRemover();

            // Should find 'table' as top element
            element = divRemover.findOnlyChild(element, "table");
View Full Code Here

                    "</null>" +
                  "</null>" +
                "</div>" +
                "</root>";

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

        // Turn the elements named "null" into elements whose name is actually
        // null.
        dom.accept(new NullRemoverTreeVisitor());

        AbstractDivRemover divRemover = getDivRemover();
        Element element = divRemover.findOnlyChild(dom.getRootElement(), "div");

        // First div (foo VF-0) should have been found.
        assertNotNull(element);
        assertTrue(element != getMultipleChildrenConstant());
        assertEquals("Foo attribute should be the same",
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.