You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by gg...@apache.org on 2019/04/20 23:32:55 UTC

[xalan-java] 01/01: This commit was manufactured by cvs2svn to create tag 'xalan-j_2_2_D7'.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to annotated tag xalan-j_2_2_D7
in repository https://gitbox.apache.org/repos/asf/xalan-java.git

commit 9dd78c2a6fe9e0350e59fbb5631b79ca34f6aa63
Author: No Author <de...@apache.org>
AuthorDate: Thu Jul 19 16:22:50 2001 +0000

    This commit was manufactured by cvs2svn to create tag
    'xalan-j_2_2_D7'.
---
 samples/CompiledJAXP/Compile.java   | 77 -------------------------------------
 samples/CompiledJAXP/Transform.java | 77 -------------------------------------
 src/trax/trax.properties            | 11 ------
 3 files changed, 165 deletions(-)

diff --git a/samples/CompiledJAXP/Compile.java b/samples/CompiledJAXP/Compile.java
deleted file mode 100644
index c42dbaa..0000000
--- a/samples/CompiledJAXP/Compile.java
+++ /dev/null
@@ -1,77 +0,0 @@
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.ObjectOutputStream;
-
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-
-import org.apache.xalan.xsltc.trax.TransformerFactoryImpl;
-
-public class Compile {
-
-    public static void main(String[] args){
-        Compile app = new Compile();
-        app.run(args[0]);
-    }
-
-    /**
-     * Compiles an XSL stylesheet into a translet, wraps the translet
-     * inside a Templates object and dumps it to a file.
-     */
-    public void run(String xsl) {
-        try {
-	    // Get an input stream for the XSL stylesheet
-	    StreamSource stylesheet = new StreamSource(xsl);
-
-	    // The TransformerFactory will compile the stylesheet and
-	    // put the translet classes inside the Templates object
-	    TransformerFactory factory = TransformerFactory.newInstance();
-	    Templates templates = factory.newTemplates(stylesheet);
-
-	    // Send the Templates object to a '.translet' file
-	    dumpTemplate(getBaseName(xsl)+".translet", templates);
-        }
-	catch (Exception e) {
-            System.err.println("Exception: " + e); 
-	    e.printStackTrace();
-        }
-        System.exit(0);
-    }
-
-    /**
-     * Returns the base-name of a file/url
-     */
-    private String getBaseName(String filename) {
-	int start = filename.lastIndexOf(File.separatorChar);
-	int stop  = filename.lastIndexOf('.');
-	if (stop <= start) stop = filename.length() - 1;
-	return filename.substring(start+1, stop);
-    }
-
-    /**
-     * Writes a Templates object to a file
-     */
-    private void dumpTemplate(String file, Templates templates) {
-	try {
-	    FileOutputStream ostream = new FileOutputStream(file);
-	    ObjectOutputStream p = new ObjectOutputStream(ostream);
-	    p.writeObject(templates);
-	    p.flush();
-	    ostream.close();
-	}
-	catch (Exception e) {
-	    System.err.println(e);
-	    e.printStackTrace();
-	    System.err.println("Could not write file "+file);
-	}
-    }
-
-    private void usage() {
-        System.err.println("Usage: compile <xsl_file>");
-        System.exit(1);
-    }
-
-}
diff --git a/samples/CompiledJAXP/Transform.java b/samples/CompiledJAXP/Transform.java
deleted file mode 100644
index 102d745..0000000
--- a/samples/CompiledJAXP/Transform.java
+++ /dev/null
@@ -1,77 +0,0 @@
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.ObjectInputStream;
-
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-
-import org.apache.xalan.xsltc.trax.TransformerFactoryImpl;
-
-public class Transform {
-
-    public static void main(String[] args){
-        Transform app = new Transform();
-        app.run(args);
-    }
-
-    /**
-     * Reads a Templates object from a file, the Templates object creates
-     * a translet and wraps it in a Transformer. The translet performs the
-     * transformation on behalf of the Transformer.transform() method.
-     */
-    public void run(String[] args){
-        String xml = args[0];
-        String translet = args[1];
-
-        try {
-	    StreamSource document = new StreamSource(xml);
-	    StreamResult result = new StreamResult(System.out);
-	    Templates templates = readTemplates(translet);
-	    Transformer transformer = templates.newTransformer();
-            transformer.transform(document, result);
-        }
-	catch (Exception e) {
-            System.err.println("Exception: " + e); 
-	    e.printStackTrace();
-        }
-        System.exit(0);
-    }
-
-    /**
-     * Reads a Templates object from a file
-     */
-    private Templates readTemplates(String file) {
-	try {
-	    FileInputStream ostream = new FileInputStream(file);
-	    ObjectInputStream p = new ObjectInputStream(ostream);
-	    Templates templates = (Templates)p.readObject();
-	    ostream.close();
-	    return(templates);
-	}
-	catch (Exception e) {
-	    System.err.println(e);
-	    e.printStackTrace();
-	    System.err.println("Could not write file "+file);
-	    return null;
-	}
-    }
-
-    /**
-     * Returns the base-name of a file/url
-     */
-    private String getBaseName(String filename) {
-	int start = filename.lastIndexOf(File.separatorChar);
-	int stop  = filename.lastIndexOf('.');
-	if (stop <= start) stop = filename.length() - 1;
-	return filename.substring(start+1, stop);
-    }
-
-    public void usage() {
-        System.err.println("Usage: run <xml_file> <xsl_file>");
-        System.exit(1);
-    }
-
-}
diff --git a/src/trax/trax.properties b/src/trax/trax.properties
deleted file mode 100644
index e593c39..0000000
--- a/src/trax/trax.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-# $Revision$ $Date$
-#
-# Note: This properties file is provided for illustrative purposes
-#       only and is not part of the interface definition.
-#       This properties file is located in the implementation JAR
-#       and different implementations will specify different
-#       implementation classes and output methods.
-#
-
-# The TRaX Stylesheet processor
-trax.processor.xslt=org.apache.xalan.processor.StylesheetProcessor


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xalan.apache.org
For additional commands, e-mail: dev-help@xalan.apache.org