Package com.volantis.mcs.dom

Examples of com.volantis.mcs.dom.Document


        TransformingVisitor visitor = createVisitor();
        String input =
                "<b>textA <strong>txt-2 <strong>txt-3</strong> txt-4</strong> textE</b>";

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

        String actual = DOMUtilities.toString(dom);

        String expected =
View Full Code Here


    public void testLinkElementFixUp() throws Exception {
        TransformingVisitor visitor = createVisitor();
        String input = "<b>textA <a>txt-2</a> textE</b>";

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

        String actual = DOMUtilities.toString(dom);

        String expected = "<b>textA <a> txt-2</a>" +
View Full Code Here

    public void testNestedLinkElementFixUp() throws Exception {
        TransformingVisitor visitor = createVisitor();
        String input = "<b>textA <a>txt-2 <a>txt-3</a> txt-4</a> textE</b>";

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

        String actual = DOMUtilities.toString(dom);

        String expected =
View Full Code Here

    protected void checkSelectorExtraction(TypeSelectorSequenceExtractor sequenceExtractor,
            String testName, String inputXml, String expectedSelectors)
            throws IOException, SAXException, ParserConfigurationException {

        // Create a styled dom from the input XML.
        Document actualXml = StyledDOMTester.createStyledDom(inputXml);

        // Extract the elements from the styled dom.
        final OutputStyledElementList outputElementList =
                new OutputStyledElementsFactory().createOutputStyledElements(
                        actualXml);
View Full Code Here

     */
    protected void checkStylesRewriter(String testName,
            String inputXml, String expectedXml)
            throws IOException, SAXException, ParserConfigurationException {

        Document styledDom = StyledDOMTester.createStyledDom(inputXml);
        OutputStyledElementsFactory factory = new OutputStyledElementsFactory();
        OutputStyledElementList outputElementList =
                factory.createOutputStyledElements(styledDom);
        OutputStyledElementIteratee iteratee = new
            DOMStyleAttributeRewriter();
View Full Code Here

                  "</table>" +               
                  "<p>content</p>" +
                  "<p>content</p>" +               
                "</html>";

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

        TransVisitor trans = getProtocolSpecificFactory().getVisitor(protocol);
        Element html = dom.getRootElement();
        trans.removeWhitespaceChildren(html);
View Full Code Here

     * @param expected the expected dom as a string
     */
    protected void doProcessingTest(String original, String expected, boolean debug)
            throws IOException, Exception {

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

        TransVisitor visitor = getProtocolSpecificFactory().
                getVisitor(protocol);

        visitor.preprocess(dom);
View Full Code Here

                            DOMProtocol protocol) throws Exception {
        String result = indent;

        if (original != null) {
            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

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

        Document dom = generateDOM(tableWithoutId);

        assertFalse("tableWithoutId failed", helper.tableHasId(
                dom.getRootElement(),
                new XHTMLBasicTransFactory(configuration), true));

        dom = generateDOM(tableWithId);

        assertTrue("tableWithId failed", helper.tableHasId(
                dom.getRootElement(),
                new XHTMLBasicTransFactory(configuration), true));
    }
View Full Code Here

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

        Document dom = generateDOM(tableWithoutBGColor);

        assertTrue("tableWithoutAttribute failed",
                !helper.tableHasAttribute(dom.getRootElement(),
                        new XHTMLBasicTransFactory(configuration),
                        "bgcolor", true));

        dom = generateDOM(tableWithBGColor);

        assertTrue("tableWithAttribute failed",
                   helper.tableHasAttribute(dom.getRootElement(),
                           new XHTMLBasicTransFactory(configuration),
                           "bgcolor", true));
    }
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.