Package betsy.common.tasks

Source Code of betsy.common.tasks.XSLTTasks

package betsy.common.tasks;

import ant.tasks.AntUtil;
import org.apache.tools.ant.taskdefs.XSLTProcess;

import java.nio.file.Path;

public class XSLTTasks {

    public static void transform(Path xslt, Path input, Path output) {
        FileTasks.assertFile(xslt);
        FileTasks.assertFile(input);

        FileTasks.assertFileExtension(xslt, ".xsl");

        XSLTProcess transform = new XSLTProcess();
        transform.setStyle(xslt.toString());
        transform.setIn(input.toFile());
        transform.setOut(output.toFile());

        transform.setTaskName("xslt");
        transform.setProject(AntUtil.builder().getProject());

        transform.execute();
    }

}
TOP

Related Classes of betsy.common.tasks.XSLTTasks

TOP
Copyright © 2018 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.