/* * $Id: xslt.java,v 1.1 2002/04/16 18:07:02 aslom Exp $ * * (C) Copyright 2002 by Yuval Oren. All rights reserved. * * This software is released under the terms of the * GNU General Public License (GPL). Full * text is available at http://www.gnu.org/licenses/gpl.html */ import java.io.*; import javax.xml.transform.*; import javax.xml.transform.stream.*; public class xslt { static public void main(String[] args) throws Exception { if (args.length < 1) { System.err.println( "Usage: java xslt style.xsl < input.xml > output.html "); System.exit(1); } new xslt(args[0]); } public xslt(String style) throws Exception { Source xmlSource = new StreamSource(System.in); Source xslSource = new StreamSource(style); Result result = new StreamResult(System.out); Transformer tx = TransformerFactory.newInstance() .newTransformer(xslSource); tx.transform(xmlSource,result); } }