/* Utilities that manipulate strings using XSLT Copyright (c) 2002-2003 The Regents of the University of California. All rights reserved. Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. PT_COPYRIGHT_VERSION_2 COPYRIGHTENDKEY @ProposedRating Yellow (eal@eecs.berkeley.edu) @AcceptedRating Red (cxh@eecs.berkeley.edu) */ package ptolemy.util; // Note that classes in ptolemy.util do not depend on any // other ptolemy packages. import java.io.ByteArrayOutputStream; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.OutputStream; import java.net.URL; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Properties; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; import org.apache.xalan.serialize.Serializer; import org.apache.xalan.serialize.SerializerFactory; import org.w3c.dom.Document; import org.xml.sax.InputSource; ////////////////////////////////////////////////////////////////////////// //// XSLTUtilities /** A collection of utilities for manipulating strings using XSLT These utilities do not depend on any other ptolemy.* packages. @author Christopher Hylands, Haiyang Zheng @version $Id: XSLTUtilities.java,v 1.13 2003/04/28 06:50:38 cxh Exp $ @since Ptolemy II 2.1 */ public class XSLTUtilities { /** Instances of this class cannot be created. */ private XSLTUtilities() { } /////////////////////////////////////////////////////////////////// //// public methods //// /** Read an input file and one or more xsl files and generate the output * file *
     *  java -classpath $PTII ptolemy.util.XSLTUtilities
     *       $PTII/ptolemy/hsif/demo/SwimmingPool/SwimmingPool.xml \
     *       $PTII/ptolemy/hsif/xsl/GlobalVariablePreprocessor.xsl \
     *       /tmp/SwimmingPool_1.xml
     * 
* @args args At least three arguments: *