All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.docx4j.openpackaging.parts.opendope.StandardisedAnswersPart Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 6.1.2
Show newest version
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));
//		
//	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy