2788N/A/*
2788N/A * CDDL HEADER START
2788N/A *
2788N/A * The contents of this file are subject to the terms of the
2788N/A * Common Development and Distribution License, Version 1.0 only
2788N/A * (the "License"). You may not use this file except in compliance
2788N/A * with the License.
2788N/A *
6982N/A * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
6982N/A * or http://forgerock.org/license/CDDLv1.0.html.
2788N/A * See the License for the specific language governing permissions
2788N/A * and limitations under the License.
2788N/A *
2788N/A * When distributing Covered Code, include this CDDL HEADER in each
6982N/A * file and include the License file at legal-notices/CDDLv1_0.txt.
6982N/A * If applicable, add the following below this CDDL HEADER, with the
6982N/A * fields enclosed by brackets "[]" replaced with your own identifying
6982N/A * information:
2788N/A * Portions Copyright [yyyy] [name of copyright owner]
2788N/A *
2788N/A * CDDL HEADER END
2788N/A *
2788N/A *
3215N/A * Copyright 2007-2008 Sun Microsystems, Inc.
2788N/A */
2788N/A
2788N/Aimport javax.xml.transform.*;
2788N/Aimport java.net.*;
2788N/Aimport java.io.*;
2788N/A
2788N/Apublic class xmlToHtml {
2788N/A
2788N/Apublic static void main(String[] args) {
2788N/A try {
2788N/A
2788N/A // xmlToHtml <xsltfile> <xmlfile> <htmlfile>
2788N/A if ( args.length != 3 ) {
2788N/A System.out.println("Error: Invalid number of args: " + args.length );
2788N/A System.out.println("Usage: xmlToHtml <xsltfile> <xmlfile> <htmlfile>");
2788N/A System.exit(1);
2788N/A }
2788N/A
2788N/A String XSLFileName=args[0];
2788N/A String XMLFileName=args[1];
2788N/A String HTMLFileName=args[2];
2788N/A
2788N/A TransformerFactory transFactory = TransformerFactory.newInstance();
2788N/A
2788N/A Transformer transformer = transFactory.newTransformer
2788N/A (new javax.xml.transform.stream.StreamSource(XSLFileName));
2788N/A
2788N/A transformer.transform
2788N/A (new javax.xml.transform.stream.StreamSource(XMLFileName),
2788N/A new javax.xml.transform.stream.StreamResult
2788N/A (new FileOutputStream(HTMLFileName))
2788N/A );
2788N/A
2788N/A }
2788N/A
2788N/A catch (Exception e) {
2788N/A e.printStackTrace( );
2788N/A }
2788N/A }
2788N/A
2788N/A}