Package com.volantis.mcs.dom

Examples of com.volantis.mcs.dom.DOMFactory.createElement()


        // Create a document where e1 parent of e2 parent of e3 and where e2
        // has no styles set.
        DOMFactory factory = DOMFactory.getDefaultInstance();
        Document document = factory.createDocument();
        Element root = factory.createElement("root");
        document.addNode(root);
        Element e1 = factory.createElement("e1");
        e1.setStyles(StylesBuilder.getCompleteStyles("line-height: normal"));
        root.addTail(e1);
        Element e2 = factory.createElement("e2");
View Full Code Here


        // has no styles set.
        DOMFactory factory = DOMFactory.getDefaultInstance();
        Document document = factory.createDocument();
        Element root = factory.createElement("root");
        document.addNode(root);
        Element e1 = factory.createElement("e1");
        e1.setStyles(StylesBuilder.getCompleteStyles("line-height: normal"));
        root.addTail(e1);
        Element e2 = factory.createElement("e2");
        e1.addTail(e2);
        Element e3 = factory.createElement("e3");
View Full Code Here

        Element root = factory.createElement("root");
        document.addNode(root);
        Element e1 = factory.createElement("e1");
        e1.setStyles(StylesBuilder.getCompleteStyles("line-height: normal"));
        root.addTail(e1);
        Element e2 = factory.createElement("e2");
        e1.addTail(e2);
        Element e3 = factory.createElement("e3");
        e3.setStyles(StylesBuilder.getCompleteStyles("line-height: normal"));
        e2.addTail(e3);
View Full Code Here

        Element e1 = factory.createElement("e1");
        e1.setStyles(StylesBuilder.getCompleteStyles("line-height: normal"));
        root.addTail(e1);
        Element e2 = factory.createElement("e2");
        e1.addTail(e2);
        Element e3 = factory.createElement("e3");
        e3.setStyles(StylesBuilder.getCompleteStyles("line-height: normal"));
        e2.addTail(e3);

        String expectedStyledElements =
                "[e3,]," + // has been cleared
View Full Code Here

     */
    private Element doFlattenTableCell(Styles styles, boolean forceLineBreak,
            boolean doInlineDiv, boolean styledParent, boolean namedParent) {

        DOMFactory domFactory = DOMFactory.getDefaultInstance();
        Element column = domFactory.createElement();
        Element newParent = domFactory.createElement();
        if (namedParent) {
            newParent.setName("div");
        }

View Full Code Here

    private Element doFlattenTableCell(Styles styles, boolean forceLineBreak,
            boolean doInlineDiv, boolean styledParent, boolean namedParent) {

        DOMFactory domFactory = DOMFactory.getDefaultInstance();
        Element column = domFactory.createElement();
        Element newParent = domFactory.createElement();
        if (namedParent) {
            newParent.setName("div");
        }

        if (styles != null) {
View Full Code Here

            if (styledParent) {
                newParent.setStyles(styles);
            }
        }

        Element child = domFactory.createElement();
        child.setName("p");
        column.addHead(child);

        MyXHTMLBasicTransformer transformer = new MyXHTMLBasicTransformer();
        DOMProtocol protocol = createProtocol();
View Full Code Here

    /**
     * Verify that an element with a non null id attribute cannot be removed.
     */
    public void testIsElementEligibleForRemovalElementWithId() {
        DOMFactory factory = DOMFactory.getDefaultInstance();
        Element div = factory.createElement("div");
        div.setAttribute("id", "myID");

        HTML_iModeDivRemover divRemover = new HTML_iModeDivRemover();
        assertEquals(false, divRemover.isDivEligibleForRemoval(div));
    }
View Full Code Here

     * Verify that an element with a non null align attribute cannot be
     * removed, unless it has the same value as the parent align attribute.
     */
    public void testIsElementEligibleForRemovalElementWithAlign() {
        DOMFactory factory = DOMFactory.getDefaultInstance();
        Element div = factory.createElement("div");
        div.setAttribute("align", "left");
        Element innerDiv = factory.createElement("div");
        innerDiv.setAttribute("align", "left");
        div.addHead(innerDiv);

View Full Code Here

     */
    public void testIsElementEligibleForRemovalElementWithAlign() {
        DOMFactory factory = DOMFactory.getDefaultInstance();
        Element div = factory.createElement("div");
        div.setAttribute("align", "left");
        Element innerDiv = factory.createElement("div");
        innerDiv.setAttribute("align", "left");
        div.addHead(innerDiv);

        HTML_iModeDivRemover divRemover = new HTML_iModeDivRemover();
        assertEquals(true, divRemover.isDivEligibleForRemoval(innerDiv));
View Full Code Here

TOP
Copyright © 2015 www.massapi.com. 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.