Package org.odftoolkit.odfdom.dom.element.text

Examples of org.odftoolkit.odfdom.dom.element.text.TextMetaElement


    // http://www.w3.org/2006/vcard/ns#fn 'John Ronald Reuel Tolkien')
    TestCase.assertEquals(1, m1.size());

    OdfContentDom contentDom = odt.getContentDom();
    XPath xpath = contentDom.getXPath();
    TextMetaElement tm = (TextMetaElement) xpath.evaluate(
        "//text:p/text:meta[last()]", contentDom, XPathConstants.NODE);

    tm.setXhtmlAboutAttribute("http://dbpedia.org/page/J._K._Rowling");
    m1 = odt.getInContentMetadataFromCache();
    PrintUtil.printOut(m1.listStatements());
    TestCase.assertEquals("http://dbpedia.org/page/J._K._Rowling", m1
        .listStatements().nextStatement().getSubject().getURI());

    tm.setTextContent("Joanne Kathleen Rowling");
    m1 = odt.getInContentMetadataFromCache();
    TestCase.assertEquals("Joanne Kathleen Rowling", m1.listStatements()
        .nextStatement().getObject().toString());

    tm.setXhtmlPropertyAttribute("dc:name");
    m1 = odt.getInContentMetadataFromCache();
    TestCase.assertEquals("http://purl.org/dc/elements/1.1/name", m1
        .listStatements().nextStatement().getPredicate().getURI());

    Node parent = tm.getParentNode();
    parent.removeChild(tm);
    m1 = odt.getInContentMetadataFromCache();
    TestCase.assertEquals(0, m1.size());
    parent.appendChild(tm);
    m1 = odt.getInContentMetadataFromCache();
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.text.TextMetaElement

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.