Package com.volantis.mcs.dom.sgml

Examples of com.volantis.mcs.dom.sgml.SGMLDTDBuilder



    }

    protected DTDBuilder createDTDBuilder() {
        return new SGMLDTDBuilder();
    }
View Full Code Here


     * this should not expand the special elements but should turn off encoding
     * for the script and style elements
     */
    public void testXMLBasedWriter() {
        StringWriter writer = new StringWriter();
        SGMLDTDBuilder builder = new SGMLDTDBuilder();

        String[] elements = new String[] {"script","style"};
        builder.setElementModel(elements,  ElementModel.CDATA);

        builder.setElementModel("base", ElementModel.EMPTY);
        builder.setElementModel("DIVIDE HINT", ElementModel.EMPTY);
        builder.setElementModel("KEEPTOGETHER", ElementModel.EMPTY);

        DTD dtd = builder.buildDTD();

        DocumentWriter dw = dtd.createDocumentWriter(writer);

        DOMDocumentOutputter outputter = new DOMDocumentOutputter(
                dw, encoder);
View Full Code Here

    public void testNonReplaceableAttributes() throws IOException {
        Element element = domFactory.createElement("a");
        element.setAttribute("href", "B&Q");
        element.setAttribute("other", "A<B");

        SGMLDTDBuilder builder = new SGMLDTDBuilder();
        builder.addNonReplaceableAttribute("href");
        DTD dtd = builder.buildDTD();

        checkOutput(dtd, element, "<a href=\"B&Q\" other=\"A&lt;B\"></a>");
    }
View Full Code Here

        Element br = domFactory.createElement("br");
        root.addTail(br);
        Element empty = domFactory.createElement("empty");
        root.addTail(empty);

        SGMLDTDBuilder builder = new SGMLDTDBuilder();
        builder.setElementModel("br", ElementModel.EMPTY);
        builder.setElementModel("empty", ElementModel.EMPTY);
        builder.setEndTagOptional("br");
        DTD dtd = builder.buildDTD();

        checkOutput(dtd, root, "<div><br><empty/></div>");
    }
View Full Code Here

        return WMLValidationHelper.getDefaultInstance();
    }

    protected DTD createDTD(InternalDevice device) {

        SGMLDTDBuilder builder = new SGMLDTDBuilder();

        populateSGMLDTDBuilder(builder, device);

        return builder.buildDTD();
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.dom.sgml.SGMLDTDBuilder

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.