Package com.volantis.mcs.dom

Examples of com.volantis.mcs.dom.Document


        deviceMock.expects.getPixelsX().returns(deviceWidth).any();

        StrictStyledDOMHelper helper = new StrictStyledDOMHelper(null, "STYLE");

        Document document = helper.parse(/*getClass().getResourceAsStream(
                "width-percentages-attributes1-input.xml")*/
                input);

        XHTMLMobile1_0_UnabridgedTransformer transformer =
                new XHTMLMobile1_0_UnabridgedTransformer(transformationConfigurationMock);
View Full Code Here


     */
    public void notestWriteProtocolString() throws Exception {
        final VolantisProtocol protocol = getProtocol();

        DOMFactory domFactory = DOMFactory.getDefaultInstance();
        final Document document = domFactory.createDocument();

        MethodInvoker invoker = new MethodInvoker() {
            public void invoke() {
                protocol.writeProtocolString(document);
            }
View Full Code Here

            SAXException,
            ParserConfigurationException {

        StrictStyledDOMHelper helper = new StrictStyledDOMHelper(null);

        Document document = helper.parse(inputXML);

        ReplacementPseudoElementFactory replacementPseudoElementFactory =
                new DefaultReplacementPseudoElementFactory(createDOMProtocol());
        PseudoElementDOMTransformer transformer =
                new PseudoElementDOMTransformer(
View Full Code Here

                    "</tr>" +
                  "</font>" +
                "</table>";

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

        Element element = (Element)dom.getRootElement().getHead();
        Element atomicElement = (Element)element.getHead().getNext();
        pushCounterpartElementDown(visitor, atomicElement, "font");

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

                    "</b>" +
                  "</font>" +
                "</table>";

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

        Element element = dom.getRootElement();

        pushStyleElementsDown(visitor, element);

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

            throws IOException,
                   SAXException,
                   ParserConfigurationException {

        StrictStyledDOMHelper styledDOMHelper = new StrictStyledDOMHelper(null);
        Document document = styledDOMHelper.parse(inputXML);

        DOMTransformer transformer = new MarkerDOMTransformer();
        transformer.transform(createDOMProtocol(), document);

        String actualXML = styledDOMHelper.render(document);

        Document styledDom = styledDOMHelper.parse(expectedXML);
        String canonicalExpectedXML = styledDOMHelper.render(styledDom);

        System.out.println("Expected: " + canonicalExpectedXML);
        System.out.println("Actual  : " + actualXML);
        assertXMLEquals("Actual XML does not match expected XML",
View Full Code Here

     * @throws Exception if there was a problem parsing the XML
     */
    public void doRemap(String expected, String original,
            TransformationConfiguration configuration) throws Exception {

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

        getTransMapper(configuration).remap(dom.getContentRoot(),
                XHTMLBasicElementHelper.getInstance());

        // Remove any null elements added by the remapping before rendering.
View Full Code Here

     *
     * @return
     */
    protected Element createImgElement() {
        StrictStyledDOMHelper domHelper = new StrictStyledDOMHelper();
        Document dom = domHelper.parse(
                "<html>" +
                        "<head>" +
                        "<title>Hello</title>" +
                        "</head>" +
                        "<body>" +
View Full Code Here

            throws IOException,
                   SAXException,
                   ParserConfigurationException {

        StrictStyledDOMHelper styledDOMHelper = new StrictStyledDOMHelper(null);
        Document document = styledDOMHelper.parse(inputXML);

        DOMTransformer transformer = new HighlightTransformer();
        transformer.transform(protocol, document);

        String actualXML = styledDOMHelper.render(document);

        Document styledDom = styledDOMHelper.parse(expectedXML);
        String canonicalExpectedXML = styledDOMHelper.render(styledDom);

        System.out.println("Expected: " + expectedXML);
        System.out.println("Actual  : " + actualXML);
        assertXMLEquals("Actual XML does not match expected XML",
View Full Code Here

        domProtocolMock.expects.getProtocolConfiguration().returns(
                protocolConfigurationMock).any();

        final StrictStyledDOMHelper domHelper = new StrictStyledDOMHelper();

        Document dom = domHelper.parse(input);
        final DOMTransformer transformer = new CSSRemappingTransformer();

        dom = transformer.transform(domProtocolMock, dom);

        assertXMLEquals("", expected, domHelper.render(dom));
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.