Java tutorial
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 The University of Tennessee and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * John Eblen - initial implementation *******************************************************************************/ import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; import org.eclipse.core.runtime.IPath; public class Main { /** * Convert XSLT file to a Source * Note that no actual file access or parsing occurs, so no exceptions are thrown. * * @param XSLTFile * @return Source */ public static Source XSLTFileToSource(IPath XSLTFile) { return new StreamSource(XSLTFile.toFile()); } }