KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icl > saxon > WinStyleSheet


1 package com.icl.saxon;
2 import com.icl.saxon.handlers.*;
3 import com.icl.saxon.expr.*;
4 import com.icl.saxon.style.*;
5 import org.xml.sax.SAXException JavaDoc;
6 import org.xml.sax.*;
7 import java.util.*;
8 import java.io.*;
9
10 /**
11   * This <B>WinStyleSheet</B> class is used in instant-saxon, a packaged
12   * interface to the StyleSheet interpreter, intended for use with jexegen
13   * on Windows platforms. It uses the SAXON version of the AElfred parser,
14   * which has been modified to deliver comments to the application.
15   */

16   
17 public class WinStyleSheet extends StyleSheet {
18
19     
20     /**
21     * Main program, can be used directly from the command line.
22     * <p>The format is:</P>
23     * <p>java com.icl.saxon.StyleSheet [-u] <I>source-file</I> <I>style-file</I> &gt;<I>output-file</I></P>
24     * <p>followed by any number of parameters in the form {keyword=value}... which can be
25     * referenced from within the stylesheet.</p>
26     * <p>The -u option indicates that the source-file and style-file are given in the form of URLs; by
27     * default they are interpreted as file names.</p>
28     * <p>This program applies the XSL style sheet in style-file to the source XML document in source-file.</p>
29     */

30     
31     public static void main (String JavaDoc args[]) throws java.lang.Exception JavaDoc
32     {
33         Properties props = System.getProperties();
34         Properties newprops = new Properties(props);
35         newprops.put("javax.xml.parsers.SAXParserFactory",
36                            "com.icl.saxon.aelfred.SAXParserFactoryImpl");
37         newprops.put("javax.xml.transform.TransformerFactory",
38                            "com.icl.saxon.TransformerFactoryImpl");
39         System.setProperties(newprops);
40         WinStyleSheet w = new WinStyleSheet();
41         w.doMain(args, w, "saxon");
42     }
43
44 }
45
46 //
47
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
48
// you may not use this file except in compliance with the License. You may obtain a copy of the
49
// License at http://www.mozilla.org/MPL/
50
//
51
// Software distributed under the License is distributed on an "AS IS" basis,
52
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
53
// See the License for the specific language governing rights and limitations under the License.
54
//
55
// The Original Code is: all this file.
56
//
57
// The Initial Developer of the Original Code is
58
// Michael Kay of International Computers Limited (mhkay@iclway.co.uk).
59
//
60
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
61
//
62
// Contributor(s): none.
63
//
64
Popular Tags