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

org.docx4j.model.datastorage.XsltProviderImpl 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: 11.4.11
Show newest version
package org.docx4j.model.datastorage;

import java.io.IOException;

import javax.xml.transform.Source;
import javax.xml.transform.Templates;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.stream.StreamSource;

import org.docx4j.XmlUtils;
import org.docx4j.utils.ResourceUtils;

public class XsltProviderImpl implements XsltProvider {


	@Override
	public Templates getFinisherXslt(String filename) throws TransformerConfigurationException  {
		
		Source xsltSource;
		try {
			xsltSource = new StreamSource(
						ResourceUtils.getResourceViaProperty(
								"docx4j.model.datastorage.XsltFinisher.xslt",
								"XsltFinisherCustom.xslt"));
		} catch (IOException e) {
			throw new TransformerConfigurationException(e.getMessage(), e);
		}
		return XmlUtils.getTransformerTemplate(xsltSource);
		
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy