org.docx4j.openpackaging.parts.opendope.StandardisedAnswersPart Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docx4j Show documentation
Show all versions of docx4j Show documentation
docx4j is a library which helps you to work with the Office Open
XML file format as used in docx
documents, pptx presentations, and xlsx spreadsheets.
package org.docx4j.openpackaging.parts.opendope;
import javax.xml.bind.JAXBContext;
import org.docx4j.openpackaging.exceptions.InvalidFormatException;
import org.docx4j.openpackaging.parts.PartName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class StandardisedAnswersPart extends JaxbCustomXmlDataStoragePart {
private static Logger log = LoggerFactory.getLogger(StandardisedAnswersPart.class);
public StandardisedAnswersPart(PartName partName) throws InvalidFormatException {
super(partName);
init();
}
public StandardisedAnswersPart(PartName partName, JAXBContext jc) throws InvalidFormatException {
super(partName, jc);
init();
}
// public static void main(String[] args) throws Docx4JException {
//
// StandardisedAnswersPart sap = new StandardisedAnswersPart(new PartName("/testing"));
//
// Answers answers = new Answers();
// Answer answer = new Answer();
// answers.getAnswerOrRepeat().add(answer);
//
// answer.setId("id1");
// answer.setValue("myval");
//
// sap.setContents(answers);
//
// System.out.println(sap.getXML());
//
// String prefixMappings = "xmlns:oda='http://opendope.org/answers'";
//
// System.out.println(
// sap.xpathGetString("/oda:answers/oda:answer", prefixMappings));
//
// sap.setNodeValueAtXPath("/oda:answers/oda:answer", "foo", prefixMappings);
//
// System.out.println(
// sap.xpathGetString("/oda:answers/oda:answer", prefixMappings));
//
// }
}