+
-
+
@@ -35,23 +33,22 @@
-
-
-
+
+
+
+
+
-
-
-
-
+
+
@@ -59,8 +56,4 @@
-
Index: xml-xalan/java/src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/domapi/XPathEvaluatorImpl.java,v
retrieving revision 1.8
diff -u -r1.8 XPathEvaluatorImpl.java
--- xml-xalan/java/src/org/apache/xpath/domapi/XPathEvaluatorImpl.java 12 Nov 2004 21:34:16 -0000 1.8
+++ xml-xalan/java/src/org/apache/xpath/domapi/XPathEvaluatorImpl.java 18 Jul 2005 02:15:05 -0000
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2004 The Apache Software Foundation.
+ * Copyright 2002-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@
/**
*
* The class provides an implementation of XPathEvaluator according
- * to the DOM L3 XPath Specification, Working Draft 28, March 2002.
+ * to the DOM L3 XPath Specification, Working Group Note 26 February 2004.
*
* See also the Document Object Model (DOM) Level 3 XPath Specification .
*
Index: xml-xalan/java/src/org/apache/xpath/domapi/XPathExpressionImpl.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/domapi/XPathExpressionImpl.java,v
retrieving revision 1.8
diff -u -r1.8 XPathExpressionImpl.java
--- xml-xalan/java/src/org/apache/xpath/domapi/XPathExpressionImpl.java 12 Nov 2004 21:34:16 -0000 1.8
+++ xml-xalan/java/src/org/apache/xpath/domapi/XPathExpressionImpl.java 18 Jul 2005 02:15:05 -0000
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2004 The Apache Software Foundation.
+ * Copyright 2002-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,10 +37,10 @@
/**
*
* The class provides an implementation of XPathExpression according
- * to the DOM L3 XPath Specification, Working Draft 28, March 2002.
+ * to the DOM L3 XPath Specification, Working Group Note 26 February 2004.
*
* See also the Document Object Model (DOM) Level 3 XPath Specification .
-
+ *
* The XPathExpression interface represents a parsed and resolved
* XPath expression.
*
@@ -76,9 +76,9 @@
/**
*
* This method provides an implementation XPathResult.evaluate according
- * to the DOM L3 XPath Specification, Working Draft 28, March 2002.
+ * to the DOM L3 XPath Specification, Working Group Note 26 February 2004.
*
- * See also the Document Object Model (DOM) Level 3 XPath Specification .
+ * See also the Document Object Model (DOM) Level 3 XPath Specification .
*
* Evaluates this XPath expression and returns a result.
* @param contextNode The context is context node for the
Index: xml-xalan/java/src/org/apache/xpath/domapi/XPathNSResolverImpl.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/domapi/XPathNSResolverImpl.java,v
retrieving revision 1.7
diff -u -r1.7 XPathNSResolverImpl.java
--- xml-xalan/java/src/org/apache/xpath/domapi/XPathNSResolverImpl.java 12 Nov 2004 21:34:16 -0000 1.7
+++ xml-xalan/java/src/org/apache/xpath/domapi/XPathNSResolverImpl.java 18 Jul 2005 02:15:05 -0000
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2004 The Apache Software Foundation.
+ * Copyright 2002-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,15 +26,15 @@
/**
*
* The class provides an implementation XPathNSResolver according
- * to the DOM L3 XPath API Specification, Working Draft 28, March 2002.
- *
+ * to the DOM L3 XPath Specification, Working Group Note 26 February 2004.
+ *
+ * See also the Document Object Model (DOM) Level 3 XPath Specification .
*
* The XPathNSResolver interface permit prefix
* strings in the expression to be properly bound to
* namespaceURI strings. XPathEvaluator can
* construct an implementation of XPathNSResolver from a node,
* or the interface may be implemented by any application.
- * See also the Document Object Model (DOM) Level 3 XPath Specification .
*
* @see org.w3c.dom.xpath.XPathNSResolver
* @xsl.usage internal
Index: xml-xalan/java/src/org/apache/xpath/domapi/XPathResultImpl.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/domapi/XPathResultImpl.java,v
retrieving revision 1.9
diff -u -r1.9 XPathResultImpl.java
--- xml-xalan/java/src/org/apache/xpath/domapi/XPathResultImpl.java 12 Nov 2004 21:34:16 -0000 1.9
+++ xml-xalan/java/src/org/apache/xpath/domapi/XPathResultImpl.java 18 Jul 2005 02:15:05 -0000
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2004 The Apache Software Foundation.
+ * Copyright 2002-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@
/**
*
* The class provides an implementation XPathResult according
- * to the DOM L3 XPath Specification, Working Draft 28, March 2002.
+ * to the DOM L3 XPath Specification, Working Group Note 26 February 2004.
*
* See also the Document Object Model (DOM) Level 3 XPath Specification .
*
Index: xml-xalan/java/xdocs/sources/xalan/commandline.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/commandline.xml,v
retrieving revision 1.28
diff -u -r1.28 commandline.xml
--- xml-xalan/java/xdocs/sources/xalan/commandline.xml 17 Feb 2004 19:25:35 -0000 1.28
+++ xml-xalan/java/xdocs/sources/xalan/commandline.xml 18 Jul 2005 02:15:06 -0000
@@ -32,7 +32,7 @@
do the following:
Download &xslt4j;.
- Set the Java classpath to include xalan.jar, xml-apis.jar, and
+ Set the Java classpath to include xalan.jar, serializer.jar, xml-apis.jar, and
&xml4j-jar; -- or another conformant XML Parser -- (see Plugging in
the Transformer and XML parser).
Call java and the Process class with the appropriate flags and
@@ -61,6 +61,7 @@
-URIRESOLVER full class name (URIResolver to be used to resolve URIs)
-ENTITYRESOLVER full class name (EntityResolver to be used to resolve entities)
-CONTENTHANDLER full class name (ContentHandler to be used to serialize output)
+-SECURE (set the secure processing feature to true)
Options for &xslt4ji;
@@ -104,12 +105,15 @@
of nodes in the source document. For more information, see NodeInfo extension functions
and source_location.
Use -URIRESOLVER with a fully qualified class name to utilize a custom implementation of the
- URIResolver TrAX interface to resolve URIs for
+ URIResolver JAXP interface to resolve URIs for
xsl:include, xsl:import, and the document() function.
Use -ENTITYRESOLVER with a fully qualified class name to utilize a custom implementation of the
EntityResolver SAX interface to handle external entity references.
Use -CONTENTHANDLER with a fully qualified class name to utilize a custom implementation of the
- ContentHandler SAX interface to serialize output.
- If you want to validate an XML document (verify that it adheres to its DOCTYPE declaration), you can use the Validate utility shipped with &xslt4j-current;.
+ ContentHandler SAX interface to serialize output.
+ If this same class implements the org.xml.sax.ext.LexicalHandler
+ interface and the output method is "xml", it will also receive lexical information about the XML document during serialization.
+ If you want to validate an XML document (verify that it adheres to its DOCTYPE declaration), you can use the
+ Validate utility shipped with &xslt4j-current;.
Index: xml-xalan/java/xdocs/sources/xalan/commandline_xsltc.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/commandline_xsltc.xml,v
retrieving revision 1.9
diff -u -r1.9 commandline_xsltc.xml
--- xml-xalan/java/xdocs/sources/xalan/commandline_xsltc.xml 17 Feb 2004 19:25:35 -0000 1.9
+++ xml-xalan/java/xdocs/sources/xalan/commandline_xsltc.xml 18 Jul 2005 02:15:07 -0000
@@ -24,7 +24,7 @@
Options
Examples
Simple FAQs
- Using the new options from TrAX
+ Using options from the JAXP transform APIs
@@ -145,16 +145,16 @@
using the -XO option because there is no default translet name in this situation.
Q: I only want to compile the stylesheet. I don't want to do a transformation.
-A: TrAX has no notion of compiling a stylesheet. However, you can achieve the same effect by
+
A: JAXP has no notion of compiling a stylesheet. However, you can achieve the same effect by
running a dummy transformation and tell &xslt4jc-short; to save the translet class. Example:
> java org.apache.xalan.xslt.Process -xsl test.xsl -xsltc -xo
This command runs a transformation on an empty input and generates the translet test.class.
-
-You can use some of the new attributes in the TransformerFactoryImpl class of &xslt4jc-short; to
-customize the translet behaviors from TrAX.
+
+You can use some of the attributes in the TransformerFactoryImpl class of &xslt4jc-short; to
+customize the translet behaviors from JAXP.
Here is the list of attributes in org.apache.xalan.xsltc.trax.TransformerFactoryImpl
and their corresponding Process command line options:
@@ -212,14 +212,14 @@
-You can set the attributes using the TrAX interface TransformerFactory.setAttribute(String name, Object value).
+
You can set the attributes using the JAXP interface TransformerFactory.setAttribute(String name, Object value).
The four attributes translet-name, destination-directory, package-name and jar-name are transient.
They only apply to the next newTemplates() or newTransformer() call. Their values are reset to
the default after the call.
The generate-translet attribute does not have a corresponding command line option. This attribute is
implied when the -XO or -XJ option is used. The purpose is to make the command line
-usage syntax a little bit simpler. Setting the generate-attribute attribute to true from TrAX is
+usage syntax a little bit simpler. Setting the generate-attribute attribute to true from JAXP is
equivalent to using the -XO option without the optional translet name from the Process command line.
If the use-classpath attribute is set to true, the translet will be loaded
@@ -228,7 +228,7 @@
to indicate which translet to use. If this attribute is not set, the name of the translet is taken from
the base name of the stylesheet. The jar-name attribute is not used in this situation.
-The following example shows you how to do the same thing from TrAX for the question 2 in the FAQ.
+The following example shows you how to do the same thing from JAXP for the question 2 in the FAQ.
// set the system property javax.xml.transform.TransformerFactory in order to use &xslt4jc-short;
Index: xml-xalan/java/xdocs/sources/xalan/downloads.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/downloads.xml,v
retrieving revision 1.6
diff -u -r1.6 downloads.xml
--- xml-xalan/java/xdocs/sources/xalan/downloads.xml 26 Feb 2004 04:02:23 -0000 1.6
+++ xml-xalan/java/xdocs/sources/xalan/downloads.xml 18 Jul 2005 02:15:07 -0000
@@ -25,38 +25,36 @@
To use &xslt4j;, you need the following:
- The JDK or JRE 1.2.2, 1.3.x, or 1.4.x
- You can get the JDK or JRE from ibm.com/java/jdk/
- or java.sun.com .
- xml-apis.jar (JAXP 1.2 implementation) and &xml4j-jar; from (or another XML Parser)
- These jars are packaged in the Xalan Java binary distributions.
+ The JDK or JRE 1.3.x, 1.4.x, or 5.x
+ You can get the JDK or JRE from
+ IBM developerWorks or java.sun.com .
+ xml-apis.jar (JAXP APIs)
+ &xml4j-jar; (or another XML Parser)
xalan.jar or xsltc.jar
- There are 2 binary distributions available; you only need to choose one of them.
- Both binary distributions contain xml-apis.jar (the JAXP 1.2 implementation) and
- &xml4j-jar; from .
-
- The first binary distribution, &xslt4j-dist-bin;.zip or &xslt4j-dist-bin;.tar.gz,
+ serializer.jar
+ (Optional) Xalan Java source code
+ (Optional) Packages to support extension functions and elements
+
+ There are 2 binary distributions available; you only need to choose one of them.
+ Both binary distributions contain xml-apis.jar and &xml4j-jar; from .
+
+ The first binary distribution, &xslt4j-dist-bin;.zip or &xslt4j-dist-bin;.tar.gz,
contains the Xalan Interpretive processor, the Xalan Compiled processor (XSLTC) and the
runtime support packages in a single jar, called xalan.jar.
- The second binary distribution, &xslt4j-dist-bin;-2jars.zip or &xslt4j-dist-bin;-2jars.tar.gz
+ The second binary distribution, &xslt4j-dist-bin;-2jars.zip or &xslt4j-dist-bin;-2jars.tar.gz
contains the Xalan Interpretive processor in xalan.jar, and the Xalan Compiled
processor (XSLTC) and the runtime support packages in xsltc.jar.
-
- The binary distributions can be downloaded from the .
- (Optional) Xalan Java source code
- There is an optional source distribution available for doing your own &xslt4j; builds; see
+
+ The binary distributions can be downloaded from the .
+ There is an optional source distribution available for doing your own &xslt4j; builds; see
Build notes. You can download the source distribution from
the .
- (Optional) Packages to support extension functions and elements
- If you plan to run XSLT extensions implemented in languages
+
If you plan to run XSLT extensions implemented in languages
other than Java, then you will need bsf.jar, which is included in both the &xslt4j; binary
and source distributions. if you plan to run XSLT extensions implemented in scripting
languages, you will need bsf.jar and one or more additional files as indicated in
extensions language requirements.
-
-
To access previous releases, see the .
-
Index: xml-xalan/java/xdocs/sources/xalan/extensions.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/extensions.xml,v
retrieving revision 1.26
diff -u -r1.26 extensions.xml
--- xml-xalan/java/xdocs/sources/xalan/extensions.xml 13 Oct 2004 20:33:42 -0000 1.26
+++ xml-xalan/java/xdocs/sources/xalan/extensions.xml 18 Jul 2005 02:15:09 -0000
@@ -78,9 +78,10 @@
downloaded from the Apache Jakarta BSF project
web site . It is required only if you have extensions written in languages other than Java.
The additional JAR files or DLLs required to support extensions written in other languages are
- listed at Jakarta BSF web site as
+ listed at the Jakarta BSF web site as
Related Projects . These files are available from the sources indicated and are not shipped
with &xslt4j;.
+
By default Xalan-Java assumes BSF support is provided by the Jakarta BSF implementation. There are three
ways of specifying the class that provides the BSF Manager service:.
Set the system property org.apache.xalan.extensions.bsf.BSFManager;
Index: xml-xalan/java/xdocs/sources/xalan/extensionslib.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/extensionslib.xml,v
retrieving revision 1.31
diff -u -r1.31 extensionslib.xml
--- xml-xalan/java/xdocs/sources/xalan/extensionslib.xml 17 Feb 2004 19:25:35 -0000 1.31
+++ xml-xalan/java/xdocs/sources/xalan/extensionslib.xml 18 Jul 2005 02:15:10 -0000
@@ -85,7 +85,7 @@
A standard XSL transformation involves an XSL stylesheet, an XML source tree, and the transformation
result tree. The transformation sends the entire result to a single
-org.apache.trax.Result object.
+javax.xml.transform.Result object.
The namespace for the Redirect
extension is:
http://xml.apache.org/xalan/redirect
@@ -268,9 +268,9 @@
Document).
-For UML Diagrams of the SQL Library, see
+
Setting up a connection
Parameterized queries
Index: xml-xalan/java/xdocs/sources/xalan/faq.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/faq.xml,v
retrieving revision 1.42
diff -u -r1.42 faq.xml
--- xml-xalan/java/xdocs/sources/xalan/faq.xml 5 Jan 2005 16:50:17 -0000 1.42
+++ xml-xalan/java/xdocs/sources/xalan/faq.xml 18 Jul 2005 02:15:11 -0000
@@ -33,7 +33,9 @@
Where can I ask questions about XSLT?
- xalan-dev and xalan-j-users are for Xalan-Java questions only. This is not the best
+
xalan-dev and
+ xalan-j-users
+ are for Xalan-Java questions only. This is not the best
forum to ask general XSLT questions. The is an
excellent place to ask XSLT questions; please search
to ensure your question has not been already asked.
@@ -50,11 +52,12 @@
to build applications that are not bound to the particular implementation details of a given
XML parser or XSL transformer.
&xslt4j; includes the JAXP packages, implements the TrAX portion of
- that API (javax.xml.transform....), and includes xercesImpl.jar from
+ that API (javax.xml.transform....), implements the XPath API of JAXP (javax.xml.xpath....),
+ and includes xercesImpl.jar from
, which implements the parser portion of the API
(javax.xml.parser....).
- For more information, see TrAX (Transformation API for XML) and
- .
+
For more information, see Using the JAXP Transform APIs and
+ .
@@ -112,9 +115,10 @@
How do I run applications that use the &xslt4j; version 1 API with &xslt4j;
- The &xslt4j; version 1 compatibility API has been deprecated and now purged, so you
- must use the &xslt4j; version 2 API. We strongly encourage you to use the JAVAX 1.2/TrAX
- API. For more information ,see the FAQ on TrAX and JAXP.
+ The &xslt4j; version 1 compatibility API has been deprecated and removed, so you
+ must use the &xslt4j; version 2 API. We strongly encourage you to use the
+ . For more information, see
+ the FAQ on TrAX and JAXP.
@@ -125,33 +129,32 @@
you place on the classpath. If this directory contains a version of DOM, JAXP, or Xerces
that predates the &xslt4j; distribution you are using, you may have problems!
The IBM JDK 1.3 includes an earlier version of xerces.jar in the lib/ext directory, a
- version that does not implement the JAXP 1.2 interfaces and therefore does not work with the
- current &xslt4j; release. Accordingly, you must either purge the
+ version that does not implement the &jaxp13-short; interfaces and therefore does not work with the
+ current &xslt4j; release. Accordingly, you must either remove the
xerces.jar that is in that directory or replace it with the xercesImpl.jar that is included
with the &xslt4j; distribution.
- The SUN JDK 1.3 includes a pre-1.1 version of the JAXP in crimson.jar. Either purge the
+
The SUN JDK 1.3 includes a pre-1.1 version of the JAXP in crimson.jar. Either remove the
crimson.jar in that directory or overwrite it with a newer crimson.jar that includes and
- implements the JAXP 1.2 interfaces.
+ implements the &jaxp13-short; interfaces.
-
- I'm having a problem running &xslt4j; on the JDK 1.4.
+
+ I'm having a problem running &xslt4j; on JDK/JRE 1.4 or higher
- The Sun JDK 1.4 is packaged with an old version (2.2D11) of &xslt4j;. The JDK 1.4 will
- attempt to use this version instead of any on the classpath. Unfortunately, this causes
- problems when attempting to use a newer version of &xslt4j; with the Sun JDK 1.4.
+ JDK/JRE 1.4, and JDK/JRE 5.0 is packaged with an old version of Xalan-Java. The JDK/JRE
+ will attempt to use this version instead of any on the classpath. Unfortunately,
+ this causes problems when attempting to use a newer version of &xslt4j;.
You can always determine which version of &xslt4j; you are running
by using the EnvironmentCheck class or by using the
xalan:checkEnvironment extension function. It is highly recommended that you use this
method to verify the version of &xslt4j; you are running, especially
before opening a bug report.
- To use a later version of &xslt4j; and
- override the one packaged with the JDK:
+ To use a newer version of &xslt4j; and override the one packaged with the JDK:
- For the SUN JDK 1.4, use the
- . Place the xalan.jar, xercesImpl.jar, and xml-apis.jar
- in the
+ use the
+ . Place the xalan.jar, serializer.jar, xercesImpl.jar
+ and xml-apis.jar in the
<java-home>\lib\endorsed directory, where
<java-home> is where the runtime software is installed.
@@ -172,19 +175,21 @@
jakarta-tomcat 4.1.* is packed
with an old version of xercesImpl.jar. Based on the , you should
- replace it with the newer xercesImpl.jar. You should add a newer xalan.jar to Tomcat as well.
- Read the FAQ about Issues running &xslt4j; on JDK 1.4. Place the
- xalan.jar and xercesImpl.jar in the <Tomcat_Home>\common\endorsed directory, where
+ replace it with the newer xercesImpl.jar. You should add a newer xalan.jar and serializer.jar
+ to Tomcat as well.
+ Read the FAQ about Issues running &xslt4j; on JDK/JRE 1.4 or higher. Place the
+ xalan.jar, serializer.jar, and xercesImpl.jar in the <Tomcat_Home>\common\endorsed directory, where
<Tomcat_Home> is where the Tomcat application server is installed.
-
+
I got javax.xml.transform.TransformerException running my applet which uses &xslt4jc-short; in JRE 1.4.
- To overwrite an older version of &xslt4j; packaged with Sun JRE 1.4 you can add a newer xalan.jar to the
- <jre-home>\lib\endorsed directory. Read the FAQ about Issues running
- &xslt4j; on JDK 1.4. If there is a META-INF/services/javax.xml.transform.TransformerFactory
+
To overwrite an older version of Xalan Java; packaged with JRE 1.4 or higher you can add a newer
+ xalan.jar and serializer.jar to the <jre-home>\lib\endorsed directory. Read the FAQ about
+ Issues running
+ &xslt4j; on JDK/JRE 1.4 or higer. If there is a META-INF/services/javax.xml.transform.TransformerFactory
file in xalan.jar (as there is in the Xalan Java distributions), then the TransformerFactoryImpl
setting in this file will be used by the JVM during the factory finder lookup procedure.
The TransformerFactoryImpl for the Xalan Java Interpretive processor is the default setting in the
@@ -290,7 +295,7 @@
JAXP uses an ordered lookup procedure to find factory implementations, such as
an implementation of javax.xml.transform.TransformerFactory. For information
- on this procedure, refer to Section 3 Plugability in .
+ on this procedure, refer to Section 3 Plugability in .
In most cases, Factory classes need only be looked up once for an application, so
performance is not an issue. However, there may be scenarios where the lookup
@@ -348,7 +353,7 @@
I'm getting a NoClassDefFound error. What has to be on the classpath?
- xalan.jar, xml-apis.jar, and xercesImpl.jar -- or the XML parser you are using -- must
+ xalan.jar, serializer.jar, xml-apis.jar, and xercesImpl.jar -- or the XML parser you are using -- must
always be on the classpath.
@@ -389,7 +394,7 @@
second element to the Document node. The solution is to either use the DocumentBuilder
newDocument() method to create a Document that does not contain an element node, or use a
DocumentFragment. It should be noted that the DocumentBuilder newDocument() method is
- "Non-preferred" according to the JAXP 1.2 documentation.
+ "Non-preferred" according to the &jaxp13-short; documentation.
@@ -412,12 +417,12 @@
SAX1 on the classpath
SAX1 should not be on your classpath. The SAX1 interfaces and implementations of the SAX1
- SAXPparser are not namespace aware.
+ SAX parser are not namespace aware.
To help diagnose your classpath, you can use the
EnvironmentCheck
utility. If you are running under JDK 1.3, see
Issues running &xslt4j; on JDK
- 1.3. If you are running a servlet, make sure the servlet engine is not placing SAX1 on the
+ 1.3. If you are running a servlet, make sure the webserver is not placing SAX1 on the
classpath.
When you create a Transformer, you must use a
@@ -692,9 +697,9 @@
means it has to catch this exception at the upper levels and unwrap the exception to pass
it on as a TransformerException.
- A JAXP 1.2 TransformerException often wraps another exception. Two of the
+ A &jaxp13-short; TransformerException often wraps another exception. Two of the
TransformerException structures that are frequently used to construct contained exceptions
- in JAXP 1.2 do not set the locator. The locator is not set because we don't know the type
+ in &jaxp13-short; do not set the locator. The locator is not set because we don't know the type
of exception that the Throwable argument represents. The solution is to chase up the
contained exceptions to find the root cause, which will usually have a location set for
you. This can be somewhat tricky, as not all the exceptions may be TransformerExceptions.
@@ -707,15 +712,15 @@
My servlet cannot find classes that implement extension functions or elements. What can I do?
- If you install xalan.jar in the servlet engine's lib directory (e.g., tomcat/lib), as
+
If you install xalan.jar in the webserver's lib directory (e.g., tomcat/lib), as
opposed to the servlet application's lib directory, then the &xslt4j; classes
are loaded by a classloader that does not see the classes in the application's classloader
(i.e., the extension classes, if you placed them there). The &xslt4j;
classes try to load the extension classes using their own classloader, and that attempt
fails.
- Workaround: place xalan.jar in the servlet application's lib directory and NOT in the servlet engine's
- lib directory. Another workaround is to place the extension classes also in the servlet
- engine's lib directory, but you generally want to avoid cluttering that directory.
+ Workaround: place xalan.jar in the servlet application's lib directory and NOT in the webserver's
+ lib directory. Another workaround is to place the extension classes also in the webserver's
+ lib directory, but you generally want to avoid cluttering that directory.
Thanks to Gunnlauger Thor Briem (gthb@dimon.is) for providing this information.
Index: xml-xalan/java/xdocs/sources/xalan/features.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/features.xml,v
retrieving revision 1.8
diff -u -r1.8 features.xml
--- xml-xalan/java/xdocs/sources/xalan/features.xml 15 Jun 2005 15:16:15 -0000 1.8
+++ xml-xalan/java/xdocs/sources/xalan/features.xml 18 Jul 2005 02:15:12 -0000
@@ -24,8 +24,7 @@
-The JAXP 1.3 Transformation API for XML ( TrAX) defines objects and
-methods for processing input and producing
+
defines objects and methods for processing input and producing
output in a variety of formats, including character streams, SAX event streams, and DOM Documents.
&jaxp13-short; defines the following features:
Index: xml-xalan/java/xdocs/sources/xalan/getstarted.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/getstarted.xml,v
retrieving revision 1.30
diff -u -r1.30 getstarted.xml
--- xml-xalan/java/xdocs/sources/xalan/getstarted.xml 26 Feb 2004 04:04:16 -0000 1.30
+++ xml-xalan/java/xdocs/sources/xalan/getstarted.xml 18 Jul 2005 02:15:12 -0000
@@ -28,19 +28,21 @@
for information on using the &xslt4j; Compiling processor.
- At the very minimum, you must include xalan.jar, xml-apis.jar, and &xml4j-jar; -- or another
- conformant XML parser -- see Plugging in a Transformer
- and XML parser) on the system classpath. To run the &xslt4ji; processor sample
- applications, include xalansamples.jar (all samples other than the servlet) and xalanservlet.jar.
- To run Javascript extensions, include bsf.jar. All these JAR files are distributed with &xslt4j;. For
- extensions implemented in other scripting language, see extensions language requirements to identify any additional JAR
- files you must place on the classpath and where you can get them.
+ At the very minimum, you must include xalan.jar, serializer.jar, xml-apis.jar,
+ and &xml4j-jar; -- or another conformant XML parser -- see Plugging in a Transformer and XML parser) on the system classpath.
+ To run the &xslt4ji; processor sample applications, include xalansamples.jar
+ (all samples other than the servlet) and xalanservlet.jar. All these JAR files are
+ distributed with &xslt4j;. To run Javascript extensions, include bsf.jar, which can
+ be obtained from the Apache Jakarta
+ BSF project . For extensions implemented in other scripting language, see
+ extensions language requirements
+ to identify any additional JAR files you must place on the classpath and where you can
+ get them.
- If you are using XSLTC, see
- Getting Starting with XSLTC.
+ If you are using XSLTC, see Getting Starting with XSLTC.
- If you are using JDK or JRE 1.2.2, 1.3.x or 1.4.x, include tools.jar on the classpath. If you
+
If you are using JDK or JRE 1.3.x or 1.4.x, include tools.jar on the classpath. If you
are using JDK or JRE 1.1.8 (supported for runtime only), then include classes.zip on the
classpath.
@@ -71,8 +73,8 @@
- java.org.apache.xalan.xslt.Process provides a basic utility for performing transformations from
- the command line. You use this utility, for example, to run several of the extensions samples.
+
org.apache.xalan.xslt.Process provides a basic utility for performing transformations from
+ the command line. You can use this utility, for example, to run several of the extensions samples.
The command line for most standard transformations is as follows:
java org.apache.xalan.xslt.Process -in [xmlSource]
-xsl [stylesheet] -out [outputfile]
@@ -89,7 +91,7 @@
You can start by using your own XML source files and XSL stylesheets with the sample applications,
which illustrate a number of the basic usage patterns.
- Here is the basic TrAX procedure to keep in mind when you set up a transformation:
+ Here is the basic procedure to keep in mind when you set up a transformation:
Use the TransformerFactory static newInstance() method to instantiate a TransformerFactory.
Use the TransformerFactory newTransformer(Source stylesheet) method to process the
Index: xml-xalan/java/xdocs/sources/xalan/index.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/index.xml,v
retrieving revision 1.58
diff -u -r1.58 index.xml
--- xml-xalan/java/xdocs/sources/xalan/index.xml 28 Apr 2004 04:14:28 -0000 1.58
+++ xml-xalan/java/xdocs/sources/xalan/index.xml 18 Jul 2005 02:15:27 -0000
@@ -30,13 +30,16 @@
&xslt4j; is an XSLT processor for transforming XML documents into
HTML, text, or other XML document types. It implements and
- . It can be used from the command line, in an applet or a
+ and can be used from the command line, in an applet or a
servlet, or as a module in other program.
- &xslt4j; recasts &xslt; as an implementation of the
- Transformation API for XML (TrAX) interfaces, part of the .
- TrAX provides a modular framework and a standard API for performing XML transformations, and
- it utilizes system properties to determine which Transformer and which XML parser to use.
- &xslt4j; also builds on and .
+ &xslt4j; implements the javax.xml.transform interface in
+ . This interface provides a modular
+ framework and a standard API for performing XML transformations, and utilizes system
+ properties to determine which Transformer and which XML parser to use.
+ &xslt4j; also implements the javax.xml.xpath interface in &jaxp13-short;, which provides an
+ object-model neutral API for evaluation of XPath expressions and access to the evaluation
+ environment.
+ &xslt4j; also builds on and .
For more information, see the release notes.
&xslt4j; version 1 is no longer supported and no longer available from xml.apache.org.
@@ -44,12 +47,13 @@
+ This release includes new features as well as a number of bug fixes. See the
+ What's New and Release
+ Notes for more details.
&xslt4j-current; works with &xml4j;, and the distribution includes xercesImpl.jar from &xml4j-used;.
- The &xslt4j; implementation is in xalan.jar. The SAX, DOM, and JAVAX interfaces are in xml-apis.jar.
- These interfaces are shared by a number of tools (&xslt4j;, &xml4j;, etc.), so placing them in a
- separate JAR simplifies coordination and reduces risk of duplication.
- Be sure to put both JAR files (and xercesImpl.jar or another JAXP 1.2-compliant XML parser) on your classpath!
-
+ The &xslt4j; implementation is in xalan.jar and serializer.jar.
+ The SAX, DOM, and &jaxp13-short; interfaces are in xml-apis.jar.
+
Index: xml-xalan/java/xdocs/sources/xalan/overview.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/overview.xml,v
retrieving revision 1.22
diff -u -r1.22 overview.xml
--- xml-xalan/java/xdocs/sources/xalan/overview.xml 26 Feb 2004 04:02:23 -0000 1.22
+++ xml-xalan/java/xdocs/sources/xalan/overview.xml 18 Jul 2005 02:15:28 -0000
@@ -28,7 +28,7 @@
-&xslt4j; (named after a rare musical instrument) fully implements
+
&xslt4j; fully implements
and the . XSLT is the first part of the XSL stylesheet language for
XML. It includes the XSL Transformation vocabulary and XPath, a language for addressing parts of
XML documents. For links to background materials, discussion groups, frequently asked questions,
@@ -37,7 +37,8 @@
For more information, see and the Apache XML FOP (Formatting Objects Project) .
XSL stylesheets are written in the XSLT language. An XSL stylesheet contains instructions
- for transforming XML documents into XML, HTML, XHTML or plain text. In structural terms, an XSL stylesheet specifies the transformation of one tree of
+ for transforming XML documents into XML, HTML, XHTML or plain text. In structural terms, an XSL
+ stylesheet specifies the transformation of one tree of
nodes (the XML input) into another tree of nodes (the output or transformation result).
The XSL stylesheet may generate and refer to cascading style sheets (CSS ) as part of its output.
@@ -70,12 +71,12 @@
a Compiling processor (XSLTC) for use in a high performance runtime environment.
Implements the relevant W3C specifications: and
.
- Implements TrAX (Transformation API for XML), now part of
- , and builds on and
- .
+ Implements , and builds on
+ and .
+ Implements the XPath API in .
May be configured to work with any XML parser, such as
&xml4j; , that implements
- (see Plugging in an XML
+ (see Plugging in an XML
parser).
Can process Stream, SAX or DOM input, and output to a Stream, SAX or DOM.
Transformations may be chained (the output of one transformation may be the input for
@@ -118,10 +119,11 @@
and XPath: A Guide to Transformations , Prentice-Hall, 2001
Michael Kay's XSLT
Programmer's Reference , 2nd ed., Wrox Press, 2001
+
Dave Pawson's to search out particular answers and
techniques
Miloslav Nic's XSL
Index: xml-xalan/java/xdocs/sources/xalan/public_apis.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/public_apis.xml,v
retrieving revision 1.1
diff -u -r1.1 public_apis.xml
--- xml-xalan/java/xdocs/sources/xalan/public_apis.xml 26 Feb 2004 14:41:31 -0000 1.1
+++ xml-xalan/java/xdocs/sources/xalan/public_apis.xml 18 Jul 2005 02:15:28 -0000
@@ -38,13 +38,15 @@
latest standard specifications.
The public interfaces of &xslt4j2; are:
- JAXP 1.2
+ JAXP 1.3
interfaces found in the
- javax.xml.parsers and
+ javax.xml.parsers ,
- javax.xml.transform packages.
- The XPath API, defined by the classes
+ javax.xml.transform and
+
+ javax.xml.xpath packages.
+ The &xslt4j2; specific XPath API, defined by the classes
org.apache.xpath.XPathAPI
@@ -92,17 +94,18 @@
specification.
If and when the specification upon which the API is based reaches its
final published form, the API could become a Public interface in
- a subsequent release of &xslt4j2;. The &xslt4j2; team could also
- decide to simply withdraw the API, if it felt that making the API
+ a subsequent release of &xslt4j2;, although the &xslt4j2; team could
+ decide to simply withdraw the API, if it decided that making the API
a public interface would not be appropriate.
As the name suggests, experimental interfaces are provided in order to
give users the opportunity to experiment with new features so that they
can provide feed-back on those features. They should not be used in
- production-level code.
+ production-level code. The &xslt4j2; team may fix severe bugs in
+ experimental interfaces.
The experimental interfaces of &xslt4j2; are:
The
-
+
DOM Level 3 XPath API found in the
org.apache.xpath.domapi package.
Index: xml-xalan/java/xdocs/sources/xalan/resources.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/resources.xml,v
retrieving revision 1.38
diff -u -r1.38 resources.xml
--- xml-xalan/java/xdocs/sources/xalan/resources.xml 3 Mar 2005 22:09:52 -0000 1.38
+++ xml-xalan/java/xdocs/sources/xalan/resources.xml 18 Jul 2005 02:15:30 -0000
@@ -79,6 +79,9 @@
+
+
+
Index: xml-xalan/java/xdocs/sources/xalan/samples.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/samples.xml,v
retrieving revision 1.62
diff -u -r1.62 samples.xml
--- xml-xalan/java/xdocs/sources/xalan/samples.xml 15 Jun 2005 15:16:15 -0000 1.62
+++ xml-xalan/java/xdocs/sources/xalan/samples.xml 18 Jul 2005 02:15:31 -0000
@@ -27,17 +27,17 @@
DOM2DOM
Pipe
UseXMLFilters
- ApplyXPath
- ApplyXPathDOM
- ApplyXPathJAXP
- XPathResolver
- ExtensionFunctionResolver
AppletXMLtoHTML
Extensions
Trace
Validate
- trax
+ trax (JAXP transform samples)
TransformThread
+ ApplyXPath
+ ApplyXPathDOM
+ ApplyXPathJAXP
+ XPathResolver
+ ExtensionFunctionResolver
&xslt4ji; servlet samples:
@@ -48,9 +48,9 @@
&xsltcsampleshead;
- Each of the subdirectories in the &xslt4j; java/samples directory
- contains the source files for one or more sample applications. The class
- files for the samples are in the following jar files:
+Each of the subdirectories in the &xslt4j; java/samples directory
+ contains the source files for one or more sample applications. The class
+ files for the samples are in the following jar files:
JAR file
@@ -84,9 +84,9 @@
With most of the samples, you can use the following procedure:
- Be sure xalan.jar, xml-apis.jar, the appropriate samples JAR file, and &xml4j-jar; are on the system class
- path. For the extension examples, bsf.jar and (for the JavaScript extensions) js.jar must also be on the class
- path.
+ Be sure xalan.jar, serializer.jar, xml-apis.jar, the appropriate samples JAR file,
+ and &xml4j-jar; are on the system class path. For the extension examples, bsf.jar
+ and (for the JavaScript extensions) js.jar must also be on the class path.
Be sure the java executable is on your path.
Go to the samples subdirectory containing the sample (use the DOS shell if you are running Windows).
Run the sample from the command line (as indicated below).
@@ -101,42 +101,54 @@
additional argument. Several samples in extensions use the &xslt4j;
command-line utility, so they take arguments for the XML source
file and the XSL stylesheet.
-
-
- What it does: The SimpleTransform class uses the birds.xsl stylesheet to transform birds.xml, and prints the
- output to birds.out.
- You can run it from the SimpleTransform subdirectory with
- java SimpleTransform
-
-
- What it does: The UseStylesheetPI class uses the stylesheet processing instruction in the XML source document to determine
- which stylesheet to use to perform the transformation.
- You can run it from the UseStylesheetPI subdirectory with
- java UseStylesheetPI
- For more information, see Working with embedded stylesheets.
-
-
- What it does: The UseStyleSheetParam class uses foo.xsl and a stylesheet parameter to transform foo.xml,
- and prints the output to System.out. The stylesheet parameter appears as a text node in the output.
- Run this sample from the UseStylesheetParam subdirectory with
- java UseStylesheetParam [param]
- where [param] is the stylesheet parameter value (a string of your choice).
-
-
- What it does: Explicitly sets the SAX XMLReader and SAX ContentHandler for processing the stylesheet (birds.xsl), processing the XML input (birds.xml), and producing the output (birds.out).
- Run this sample from the SAX2SAX subdirectory with
+
+
+
+
+ What it does: The SimpleTransform class uses the birds.xsl stylesheet to transform birds.xml, and prints the
+ output to birds.out.
+ You can run it from the SimpleTransform subdirectory with
+ java SimpleTransform
+
+
+
+
+ What it does: The UseStylesheetPI class uses the stylesheet processing instruction in the XML source document to determine
+ which stylesheet to use to perform the transformation.
+ You can run it from the UseStylesheetPI subdirectory with
+ java UseStylesheetPI
+ For more information, see Working with embedded stylesheets.
+
+
+
+
+ What it does: The UseStyleSheetParam class uses foo.xsl and a stylesheet parameter to transform foo.xml,
+ and prints the output to System.out. The stylesheet parameter appears as a text node in the output.
+ Run this sample from the UseStylesheetParam subdirectory with
+ java UseStylesheetParam [param]
+ where [param] is the stylesheet parameter value (a string of your choice).
+
+
+
+
+ What it does: Explicitly sets the SAX XMLReader and SAX ContentHandler for processing the stylesheet (birds.xsl), processing the XML input (birds.xml), and producing the output (birds.out).
+ Run this sample from the SAX2SAX subdirectory with
java SAX2SAX
-
-
- What it does: the DOM2DOM class uses the birds.xsl stylesheet to transform a DOM Document generated from birds.xml,
- produces an output DOM, and traverses the DOM, printing the traversal to System.out. In contrast to SimpleTransform,
- DOM2DOM illustrates the procedure for processing an input DOM and creating an output DOM that is available for
- further processing.
+
+
+
+
+ What it does: the DOM2DOM class uses the birds.xsl stylesheet to transform a DOM Document generated from birds.xml,
+ produces an output DOM, and traverses the DOM, printing the traversal to System.out. In contrast to SimpleTransform,
+ DOM2DOM illustrates the procedure for processing an input DOM and creating an output DOM that is available for
+ further processing.
You can run it from the DOM2DOM subdirectory with
- java DOM2DOM
-
-
- What it does: Pipes the output from one transformation to a second transformation, then from the second
+
java DOM2DOM
+
+
+
+
+ What it does: Pipes the output from one transformation to a second transformation, then from the second
transformation to the third transformation. Transformer1 is the ContentHandler for the XMLReader (which parses the
input document). Transformer2 provides the ContentHandler for Transformer1, and Transformer3 for Transformer2.
Pipe and UseXMLFilters illustrate two strategies for using the output of one transformation as the input for
@@ -145,100 +157,32 @@
and so on.
Run this sample from the Pipe subdirectory with
java Pipe
-
+
+
+
What it does: Chains together the same transformations as the preceding Pipe sample. Using each Transformer
- object as an extension of the SAX XMLFilter interface, sets the XMLReader as the parent of filter1,
- filter1 as the parent of filter2, and filter2 as the parent of of filter3.
-
- Run this sample from the UseXMLFilters subdirectory with
- java UseXMLFilters
-
-
- What it does: ApplyXPath uses the XPathAPI convenience methods to
- execute an XPath expression against an XML document and return the nodes (if any) it finds.
- You can use this sample as an aid when you want to find out what a given XPath expression returns from a
- given XML file. Keep in mind that the context node (base point of evaluation) for the XPath expression is the document
- root.
- Run this sample from the ApplyXPath subdirectory with
- java ApplyXPath [XMLFile XPathExpression]
- where [XMLFile] is an XML source file and [XPathExpression] is an XPath expression to
- apply to that file. The ApplyXPath subdirectory contains an XML file named foo.xml --
- <doc><name first="David" last="Marston"/>...</doc> -- so you can try command
- lines like
- java ApplyXPath foo.xml /
- and
- java ApplyXPath foo.xml /doc/name/@first
- For more information, see Working with XPath expressions.
-
-
- What it does: ApplyXPathDOM is very similar to the ApplyXPath sample, but it uses the API
- in the DOM Level 3 XPath
- Specification to execute an XPath expression against an XML document and return
- the nodes (if any) it finds. At the time of writing the DOM Level 3 XPath Specification is in
- Last Call .
- You can use this sample as an aid when you want to find out what a given XPath expression returns from a
- given XML file. Keep in mind that the context node (base point of evaluation) for the XPath expression is the document
- root.
- Run this sample from the ApplyXPathDOM subdirectory with
- java ApplyXPathDOM [XMLFile XPathExpression]
- where [XMLFile] is an XML source file and [XPathExpression] is an XPath expression to
- apply to that file. The ApplyXPathDOM subdirectory contains an XML file named foo.xml --
- <doc><name first="David" last="Marston"/>...</doc> -- so you can try command
- lines like
- java ApplyXPathDOM foo.xml /
- and
- java ApplyXPathDOM foo.xml /doc/name/@first
- For more information, see Working with XPath expressions.
+ object as an extension of the SAX XMLFilter interface, sets the XMLReader as the parent of filter1,
+ filter1 as the parent of filter2, and filter2 as the parent of of filter3.
+
+ Run this sample from the UseXMLFilters subdirectory with
+ java UseXMLFilters
-
-
- What it does: ApplyXPathJAXP is similar to the ApplyXPath sample, but it uses the XPath API in &jaxp13-short;
- to evaluate an XPath expression against an XML document and return the evaluation result in the specified type.
- Run this sample from the XPathAPI subdirectory with
- java ApplyXPathJAXP [XMLFile XPathExpression ReturnType]
- where [XMLFile] is an XML source file, [XPathExpression] is an XPath expression to
- apply to that file, and [ReturnType] is one of the strings from the list {"num", "bool", "str", "node", "nodeset"}
- designating the return type of the evaluation. The XPathAPI subdirectory contains an XML file named
- foo.xml. So you can try command lines like
- java ApplyXPathJAXP foo.xml /doc/name[1]/@last str
- and
- java ApplyXPathJAXP foo.xml /doc/name nodeset
-
-
-
-
- What it does: XPathResolver provides sample implementations of the NamespaceContext, XPathFunctionResolver
- and XPathVariableResolver interfaces described in the
- JAXP 1.3 XPath API.
- The sample demonstrates how these implementations can be used to to evaluate XPath expressions that contain
- extension functions and references to variables.
- Run this sample from the XPathAPI subdirectory with
- java XPathResolver
-
-
-
-
- What it does: ExtensionFunctionResolver demonstrates how to use the sample implementation of XPathFunctionResolver to
- evaluate XPath expressions containing Java or EXSLT extension functions.
- To run this sample from the XPathAPI subdirectory, you need to compile ExtensionTest.java first and put
- the XPathAPI directory on your classpath. Run the sample using
- java ExtensionFunctionResolver
-
This applet uses a stylesheet to transform an XML document into HTML. It displays the XML document, the
stylesheet, and the HTML output.
- How to run it: Open appletXMLtoHTML.hmtl in the Internet Explorer 5 browser.
+ How to run it: Open appletXMLtoHTML.html in the Internet Explorer 5 browser.
For information about running &xslt4j; applets in Netscape Communicator, see Problems
with Netscape.
- This applet looks for xalan.jar, xml-apis.jar, and xercesImpl.jar (Xerces-J2) or xerces.jar (Xerces-J 1) in the bin
- subdirectory. If you have placed these JAR files
+ This applet looks for xalan.jar, xml-apis.jar, serializer.jar, and xercesImpl.jar in the bin subdirectory. If you have placed these JAR files
elsewhere, adjust the applet archive setting in client.html accordingly.
-
+
+
+
- For a general introduction, see Using &xslt4j; in a servlet.
+ For a general introduction, see Using &xslt4j; in a servlet.
The servlet subdirectory contains four sample servlets and one JSP that use &xslt4j; to perform transformations. The sample
code is compiled and packed in xalanservlet.war. To run these samples, you must place
xalanservlet.war on a web server with a servlet engine. For example, using jakarta-tomcat 4.1.18 .
@@ -264,81 +208,83 @@
and returns the transformation result to the HTTP client.
To run this servlet: set up an HTML page to call the servlet as
follows:
-http://localhost:port/xalanservlet/SimpleXSLTServlet
-
-
- Paul Campbell <seapwc@halcyon.com> wrote this servlet and the following explanatory text.
- Thank you, Paul!
- What it does: The client (perhaps an HTML form) specifies an XML document, a stylesheet, and a value to be passed
- to the stylesheet for a stylesheet parameter named "param1". The servlet performs the transformation and returns
- the output to the client. The client must specify which stylesheet (containing a "param1" stylesheet parameter")
- and XML file are to be used or use sample files fooparam.xml and fooparam.xsl.
- How to run it: set up an HTML client to call the servlet with arguments along the lines of
+ http://localhost:port/xalanservlet/SimpleXSLTServlet
+
+
+ Paul Campbell <seapwc@halcyon.com> wrote this servlet and the following explanatory text.
+ Thank you, Paul!
+ What it does: The client (perhaps an HTML form) specifies an XML document, a stylesheet, and a value to be passed
+ to the stylesheet for a stylesheet parameter named "param1". The servlet performs the transformation and returns
+ the output to the client. The client must specify which stylesheet (containing a "param1" stylesheet parameter")
+ and XML file are to be used or use sample files fooparam.xml and fooparam.xsl.
+ How to run it: set up an HTML client to call the servlet with arguments along the lines of
http://localhost:port/xalanservlet/UseStylesheetParamServlet?
XML=fooparam.xml&XSL=fooparam.xsl&PVAL=GoodBye
- In the doGet() method, the servlet obtains the PVAL value "GoodBye" from the servlet request and passes it to the
- stylesheet as the paramValue argument in a Transformer setParameter() call:
- String paramValue = httpServletRequest.getParameter("PVAL");
- ...
- transformer.setParameter("param1", paramValue);
- The result is returned to the client:
-<html><body><p>GoodBye</p></body></html>
-
-
- Paul Campbell <seapwc@halcyon.com> wrote this Java Server Page.
- This Java Server Page performs essentially the same operation as
- servlet.UseStylesheetParamServlet. It applies a stylesheet parameter
- to a stylesheet (fooparam.xsl), applies the stylesheet to an XML source document (fooparam.xml), and returns the
- result.
- Call JSP as follows:
- http://localhost:port/xalanservlet/jspSample.jsp?
+ In the doGet() method, the servlet obtains the PVAL value "GoodBye" from the servlet request and passes it to the
+ stylesheet as the paramValue argument in a Transformer setParameter() call:
+ String paramValue = httpServletRequest.getParameter("PVAL");
+ ...
+ transformer.setParameter("param1", paramValue);
+ The result is returned to the client:
+ <html><body><p>GoodBye</p></body></html>
+
+
+ Paul Campbell <seapwc@halcyon.com> wrote this Java Server Page.
+ This Java Server Page performs essentially the same operation as
+ servlet.UseStylesheetParamServlet. It applies a stylesheet parameter
+ to a stylesheet (fooparam.xsl), applies the stylesheet to an XML source document (fooparam.xml), and returns the
+ result.
+ Call JSP as follows:
+ http://localhost:port/xalanservlet/jspSample.jsp?
XML=fooparam.xml&XSL=fooparam.xsl&PMA=GoodBye
- The JSP obtains the PMA value "GoodBye" from the http request and passes it to the stylesheet as the
- paramValue argument in a Transformer setParameter() call.
-
-
- What it does: servlet.XSLTServletWithParams takes parameters in the request -- a URL parameter for
- the XML input document URL and an xslURL parameter for the stylesheet URL.
- To use XSLTServletWithParams to perform the same transformation as SimplestServlet:
- use birds.xsl and birds.xml as examples. Set up an HTML page to call the servlet as follows:
-http://localhost:port/xalanservlet/XSLTServletWithParams?URL=birds.xml&
-xslURL=birds.xsl
- If the XML document contains an associated stylesheet (a stylesheet Processing Instruction) that you want to use, simply omit the
- xslURL parameter.
- If the stylesheet takes stylesheet parameters, you can include them in the URL. For example to set the param1
- stylesheet parameter to foo, include param1=foo in the URL.
-
-
+ The JSP obtains the PMA value "GoodBye" from the http request and passes it to the stylesheet as the
+ paramValue argument in a Transformer setParameter() call.
+
+
+ What it does: servlet.XSLTServletWithParams takes parameters in the request -- a URL parameter for
+ the XML input document URL and an xslURL parameter for the stylesheet URL.
+ To use XSLTServletWithParams to perform the same transformation as SimplestServlet:
+ use birds.xsl and birds.xml as examples. Set up an HTML page to call the servlet as follows:
+ http://localhost:port/xalanservlet/XSLTServletWithParams?URL=birds.xml&
+ xslURL=birds.xsl
+ If the XML document contains an associated stylesheet (a stylesheet Processing Instruction) that you want to use, simply omit the
+ xslURL parameter.
+ If the stylesheet takes stylesheet parameters, you can include them in the URL. For example to set the param1
+ stylesheet parameter to foo, include param1=foo in the URL.
+
+
What it does: The client (which you must set up) specifies an XML document and a stylesheet. The servlet
- performs the transformation and returns the output to the client. You can use media.properties to specify
+ performs the transformation and returns the output to the client. You can use media.properties to specify
which stylesheet is to be used depending on the client browser/device.
The source files for this servlet, including ApplyXSLT.java, ApplyXSLTProperties.java, DefaultApplyXSLTProperties.java,
ApplyXSLTListener.java, ApplyXSLTException.java. booklist1.xsl, booklist2.xsl and catalog.xml,
are provided for testing.
To run the servlet: set system property server.root=server root. Set up an HTML page to call
- servlet.ApplyXSLT with arguments as illustrated below.
+ servlet.ApplyXSLT with arguments as illustrated below.
The files catalog.xml, booklist1.xsl and booklist2.xsl are used in the following example.
- In the deployment descriptor, booklist1.xsl is set as the default xsl file. If you create these files yourself, make sure that you set the output method
- to "xml" in the stylesheet.
- Examples:
-
-http://localhost:port/xalanservlet/ApplyXSLT?URL=/xalanservlet/catalog.xml&xslURL=
-/xalanservlet/booklist2.xsl
-- ...applies the booklist2.xsl stylesheet to the catalog.xml data. Both files are
-served from the Web server's HTTP document root.
-http://localhost:port/xalanservlet/ApplyXSLT?URL=/xalanservlet/catalog.xml&xslURL=
-/xalanservlet/booklist2.xsl&debug=true
-- ...ensures that XML and XSL processor messages are returned in the event of problems
-applying booklist2.xsl to catalog.xml
-http://localhost:port/xalanservlet/ApplyXSLT/xalanservlet/catalog.xml?xslURL=/xalanservlet/booklist2.xsl
-- ...applies the booklist2.xsl stylesheet to the catalog.xml data, just like the first example.
-This is an alternative way of specifying the XML XSLTInputSource by utilizing the HTTP request's path
-information.
-http://localhost:port/xalanservlet/ApplyXSLT/xalanservlet/catalog.xml
-- ...examines catalog.xml for an associated XSL stylesheet booklist1.xsl (a stylesheet Processing Instruction). If multiple XSLs are associated with the data, the stylesheet whose media attribute maps to your browser type will be chosen. If no mapping is successful, the primary associated stylesheet is used.
-
-
-
+ In the deployment descriptor, booklist1.xsl is set as the default xsl file. If you create these
+ files yourself, make sure that you set the output method to "xml" in the stylesheet.
+ Examples:
+
+ http://localhost:port/xalanservlet/ApplyXSLT?URL=/xalanservlet/catalog.xml&xslURL=
+ /xalanservlet/booklist2.xsl
+ - ...applies the booklist2.xsl stylesheet to the catalog.xml data. Both files are
+ served from the Web server's HTTP document root.
+ http://localhost:port/xalanservlet/ApplyXSLT?URL=/xalanservlet/catalog.xml&xslURL=
+ /xalanservlet/booklist2.xsl&debug=true
+ - ...ensures that XML and XSL processor messages are returned in the event of problems
+ applying booklist2.xsl to catalog.xml
+ http://localhost:port/xalanservlet/ApplyXSLT/xalanservlet/catalog.xml?xslURL=/xalanservlet/booklist2.xsl
+ - ...applies the booklist2.xsl stylesheet to the catalog.xml data, just like the first example.
+ This is an alternative way of specifying the XML XSLTInputSource by utilizing the HTTP request's path
+ information.
+ http://localhost:port/xalanservlet/ApplyXSLT/xalanservlet/catalog.xml
+ - ...examines catalog.xml for an associated XSL stylesheet booklist1.xsl (a stylesheet Processing Instruction). If multiple XSLs are associated with the data, the stylesheet whose media attribute maps to your browser type will be chosen. If no mapping is successful, the primary associated stylesheet is used.
+
+
+
+
+
For an introduction to the creation and use of extension elements and extension functions, and
for information about the extensions library distributed with the &xslt4j; Interpretive processor,
@@ -355,123 +301,124 @@
The extensions subdirectory contains six samples with &xslt4j; Interpretive extensions. Two of the samples use
extensions implemented in JavaScript, and four of the samples use extensions implemented in Java.
- To run these examples, you must place bsf.jar (distributed with &xslt4j;), and js.jar
- (version 1.5, available from
- http://www.mozilla.org/rhino ) on the classpath.
+
To run these examples, you must place bsf.jar and js.jar (version 1.5, available from
+ http://www.mozilla.org/rhino ) on the classpath.
You do not need js.jar on the classpath for the samples that use Java extensions.
- Problems related to JDK 1.4
+ Problems related to JDK 1.4 or higher.
Use java.org.apache.xalan.xslt.Process, the &xslt4j; command-line utility, to run most of these samples from
- the command line. The command line must include an -in flag with the
- XML source and an -xsl flag with the XSL stylesheet. If you want the output to be written to a file, rather
- than to the screen, add an -out flag with the output file name.
- Run these samples from the extensions directory as follows (each of the following is a single command
- line):
+ the command line. The command line must include an -in flag with the
+ XML source and an -xsl flag with the XSL stylesheet. If you want the output to be written to a file, rather
+ than to the screen, add an -out flag with the output file name.
+ Run these samples from the extensions directory as follows (each of the following is a single command
+ line):
-
-
- What it does: Uses the Redirect extension elements shipped with &xslt4j; to direct output to two output
- files.
- Run this sample from the extensions subdirectory with
+
+
+ What it does: Uses the Redirect extension elements shipped with &xslt4j; to direct output to two output
+ files.
+ Run this sample from the extensions subdirectory with
java org.apache.xalan.xslt.Process -in 1-redir.xml
-xsl 1-redir.xsl
- The standard (non-redirected) output is written to the screen. The redirected output is written to 1-redir-out, or
+
The standard (non-redirected) output is written to the screen. The redirected output is written to 1-redir-out, or
whatever filename you assign to the doc/foo @file attribute in 1-redir.xml. The stylesheet gets the file name for
redirected output from the XML input file.
-
-
- What it does: Uses an extension element and extension function implemented in JavaScript to compute a
+
+
+ What it does: Uses an extension element and extension function implemented in JavaScript to compute a
deadline for responding to a customer inquiry.
- js.jar must be on the classpath.
- Run this sample from the extensions subdirectory with
- java org.apache.xalan.xslt.Process -in 2-basicJscript.xml
- -xsl 2-basicJscript.xsl
-
-
- What it does: Uses extension functions to format dates. This sample illustrates use of the predefined java
- extension namespace to provide ready access to extensions implemented in Java.
- Run this sample from the extensions subdirectory with
- java org.apache.xalan.xslt.Process -in 3-java-namespace.xml
- -xsl 3-java-namespace.xsl
-
-
- What it does: Uses a Java extension to transform a set of name elements into a numbered and alphabetized
- list.
- Run this sample from the extensions subdirectory with
- java org.apache.xalan.xslt.Process -in numlist.xml
- -xsl 4-numlistJava.xsl
-
-
- What it does: Uses a JavaScript extension to transform a set of name elements into a numbered and
- alphabetized list. This sample performs the same operations as the preceding Java extension.
- js.jar must be on the classpath.
+ js.jar must be on the classpath.
+ Run this sample from the extensions subdirectory with
+ java org.apache.xalan.xslt.Process -in 2-basicJscript.xml
+ -xsl 2-basicJscript.xsl
+
+
+ What it does: Uses extension functions to format dates. This sample illustrates use of the predefined java
+ extension namespace to provide ready access to extensions implemented in Java.
+ Run this sample from the extensions subdirectory with
+ java org.apache.xalan.xslt.Process -in 3-java-namespace.xml
+ -xsl 3-java-namespace.xsl
+
+
+ What it does: Uses a Java extension to transform a set of name elements into a numbered and alphabetized
+ list.
+ Run this sample from the extensions subdirectory with
+ java org.apache.xalan.xslt.Process -in numlist.xml
+ -xsl 4-numlistJava.xsl
+
+
+ What it does: Uses a JavaScript extension to transform a set of name elements into a numbered and
+ alphabetized list. This sample performs the same operations as the preceding Java extension.
+ js.jar must be on the classpath.
Run this sample from the extensions subdirectory with
- java org.apache.xalan.xslt.Process -in numlist.xml
- -xsl 5-numlistJscript.xsl
-
-
-
- The SQL library extension enables you to execute SQL queries from within a stylesheet,
- and to incorporate query result sets in the XML output. To use the SQL library, you need
- a JDBC driver, the underlying DBMS, and a database. Our samples use Lutris® InstantDB.
- You can also customize the stylesheets for your own database implementations.
-
-
- To run the SQL library extension samples, do the following:
-
- InstantDB is no longer freely available. If you still have a copy of it,
- you can follow the instructions Lutris provides for installing InstantDB and generating the sample database.
- For other database implementations, you have to customize the stylesheets by modifying the SQL query, the JDBC driver name and the database url:
-
- Modify the SQL query to your own needs. The SQL query is defined in a parameter like
- <xsl:param name="query" select="'SELECT * FROM import1'"/>.
- Modify the JDBC driver name and the database url. They are specified in the stylesheets as parameters for some
- examples. For other examples the parameters are defined in the basic-connection/dbinfo.xml and basic-connection/dbtest.xsl.
-
-
- Add the JDBC driver jar to the system class path.
- Create the database you want to work with if it does not already exist.
-
-
-
+ java org.apache.xalan.xslt.Process -in numlist.xml
+ -xsl 5-numlistJscript.xsl
+
+
+
+
+
+ The SQL library extension enables you to execute SQL queries from within a stylesheet,
+ and to incorporate query result sets in the XML output. To use the SQL library, you need
+ a JDBC driver, the underlying DBMS, and a database. Our samples use Lutris® InstantDB.
+ You can also customize the stylesheets for your own database implementations.
+
+
+ To run the SQL library extension samples, do the following:
+
+ InstantDB is no longer freely available. If you still have a copy of it,
+ you can follow the instructions Lutris provides for installing InstantDB and generating the sample database.
+ For other database implementations, you have to customize the stylesheets by modifying the SQL query, the JDBC driver name and the database url:
+ Modify the SQL query to your own needs. The SQL query is defined in a parameter like
+ <xsl:param name="query" select="'SELECT * FROM import1'"/>.
+ Modify the JDBC driver name and the database url. They are specified in the stylesheets as parameters for some
+ examples. For other examples the parameters are defined in the basic-connection/dbinfo.xml and basic-connection/dbtest.xsl.
+
+
+ Add the JDBC driver jar to the system class path.
+ Create the database you want to work with if it does not already exist.
+
+
+
+
6-sqllib-instantdb
Basic Connections
ExternalConnection
Parameterized query
Streamable
Show-error
-
- Except for 6-sqllib-instantdb, all these samples have been created by John Gentilin
- (johnglinux@eyecatching.com) to illustrate the rich feature set he has contributed to the SQL Library.
- To run each of these samples, be sure you are in the appropriate extensions/sql subdirectory.
-
-
- What it does: Uses the SQL library XConnection extension to connect to the InstantDB sample database,
- performs a query, and returns the query result in an HTML table.
- Set up the database, and run this sample from the extensions subdirectory:
- java org.apache.xalan.xslt.Process
- -xsl 6-sqllib-instantdb.xsl -out import1.html
-
-
- Contributed by John Gentilin (johnglinux@eyecatching.com).
- What it does: illustrates two strategies for connecting to a database, executing a static query, and returning
- the query result.
- The first strategy is to get connection information along with the static query from the stylesheet (dbtest.xsl)\
- in the form of stylesheet parameters.
- The second strategy is to get connection information from a nodeset in an XML source document (dbInfo.xml).
+
+ Except for 6-sqllib-instantdb, all these samples have been created by John Gentilin
+ (johnglinux@eyecatching.com) to illustrate the rich feature set he has contributed to the SQL Library.
+ To run each of these samples, be sure you are in the appropriate extensions/sql subdirectory.
+
+
+ What it does: Uses the SQL library XConnection extension to connect to the InstantDB sample database,
+ performs a query, and returns the query result in an HTML table.
+ Set up the database, and run this sample from the extensions subdirectory:
+ java org.apache.xalan.xslt.Process
+ -xsl 6-sqllib-instantdb.xsl -out import1.html
+
+
+ Contributed by John Gentilin (johnglinux@eyecatching.com).
+ What it does: illustrates two strategies for connecting to a database, executing a static query, and returning
+ the query result.
+ The first strategy is to get connection information along with the static query from the stylesheet (dbtest.xsl)\
+ in the form of stylesheet parameters.
+ The second strategy is to get connection information from a nodeset in an XML source document (dbInfo.xml).
- Set up the database, and run this sample from the extensions/sql/basic-connection
- directory.
- 1. To get connection information from the stylesheet:
- java org.apache.xalan.xslt.Process
- -xsl dbtest.xsl -out import1.html
- 2. To get connection information in the form of a nodeset from the XML source document:
- java org.apache.xalan.xslt.Process
- -in dbinfo.xml -xsl dbtest-cinfo.xsl
- -out import1.html
- 3. To get connection information from the stylesheet and dump the raw result set to an XML file:
- java org.apache.xalan.xslt.Process
- -xsl DumpSQL.xsl -out import1.xml
+ Set up the database, and run this sample from the extensions/sql/basic-connection
+ directory.
+ 1. To get connection information from the stylesheet:
+ java org.apache.xalan.xslt.Process
+ -xsl dbtest.xsl -out import1.html
+ 2. To get connection information in the form of a nodeset from the XML source document:
+ java org.apache.xalan.xslt.Process
+ -in dbinfo.xml -xsl dbtest-cinfo.xsl
+ -out import1.html
+ 3. To get connection information from the stylesheet and dump the raw result set to an XML file:
+ java org.apache.xalan.xslt.Process
+ -xsl DumpSQL.xsl -out import1.xml
Contributed by John Gentilin (johnglinux@eyecatching.com).
@@ -515,24 +462,26 @@
What it does: use the SQL library ExtensionError class to return an error message in the output stream. The stylesheet
calls a template with a select statement that returns a nodeset when an error occurs.
<xsl:variable name="table" select='sql:query($db, $query)'/>
- <xsl:apply-templates select="$table/row-set" />
- <xsl:apply-templates select="$table/ext-error"/>
- Set up the database, and run this sample from the extensions/sql/show-error subdirectory:
- java org.apache.xalan.xslt.Process
- -xsl [invalidSomething.xsl] -out dbtestout.html
- where [invalidSomething.xsl] is invalidConn.xsl (specifies a database that does not exist),
- invalidQuery.xsl (specifies a table that does not exist), or invalidPQuery.xsl (includes
- too many parameters for the parameterized query).
+ <xsl:apply-templates select="$table/row-set" />
+ <xsl:apply-templates select="$table/ext-error"/>
+ Set up the database, and run this sample from the extensions/sql/show-error subdirectory:
+ java org.apache.xalan.xslt.Process
+ -xsl [invalidSomething.xsl] -out dbtestout.html
+ where [invalidSomething.xsl] is invalidConn.xsl (specifies a database that does not exist),
+ invalidQuery.xsl (specifies a table that does not exist), or invalidPQuery.xsl (includes
+ too many parameters for the parameterized query).
-
+
+
+
What it does: Trace uses the TraceListener and TraceManager classes to log transformation events.
Run this sample from the Trace subdirectory with
java Trace
and examine the result in events.log. Additionally, run this sample from the extensions subdirectory with
java Trace 3-java-namespace
- for the trace of a stylesheet with extensions. For more information, see Debugger
- Interface
+ for the trace of a stylesheet with extensions. For more information, see Debugger Interface
@@ -562,9 +511,10 @@
with the includes. Check an "included" file (such as history.xml) as if it were an independent document and it fails.
+
-
- What it does: runs a number of samples illustrating uses of the TrAX (Transformation API for XML) interfaces.
+
+ What it does: runs a number of samples illustrating uses of the JAXP transform interfaces.
Run this sample from the trax subdirectory with
java Examples
and examine the source in Examples.java and ExampleContentHandler.java.
@@ -577,5 +527,81 @@
java TransformThread
and examine the source in TransformThread.java. A more detailed description along with configuration options are listed in the header.
+
+
+
+ What it does: ApplyXPath uses the convenience methods in the &xslt4j2; specific XPathAPI to
+ execute an XPath expression against an XML document and return the nodes (if any) it finds.
+ You can use this sample as an aid when you want to find out what a given XPath expression returns from a
+ given XML file. Keep in mind that the context node (base point of evaluation) for the XPath expression is the document
+ root.
+ Run this sample from the ApplyXPath subdirectory with
+ java ApplyXPath [XMLFile XPathExpression]
+ where [XMLFile] is an XML source file and [XPathExpression] is an XPath expression to
+ apply to that file. The ApplyXPath subdirectory contains an XML file named foo.xml --
+ <doc><name first="David" last="Marston"/>...</doc> -- so you can try command
+ lines like
+ java ApplyXPath foo.xml /
+ and
+ java ApplyXPath foo.xml /doc/name/@first
+ For more information, see Working with XPath expressions.
+
+
+
+
+ What it does: ApplyXPathDOM is very similar to the ApplyXPath sample, but it uses the API
+ in the DOM Level 3 XPath
+ Specification to execute an XPath expression against an XML document and return
+ the nodes (if any) it finds.
+ You can use this sample as an aid when you want to find out what a given XPath expression returns from a
+ given XML file. Keep in mind that the context node (base point of evaluation) for the XPath expression is the document
+ root.
+ Run this sample from the ApplyXPathDOM subdirectory with
+ java ApplyXPathDOM [XMLFile XPathExpression]
+ where [XMLFile] is an XML source file and [XPathExpression] is an XPath expression to
+ apply to that file. The ApplyXPathDOM subdirectory contains an XML file named foo.xml --
+ <doc><name first="David" last="Marston"/>...</doc> -- so you can try command
+ lines like
+ java ApplyXPathDOM foo.xml /
+ and
+ java ApplyXPathDOM foo.xml /doc/name/@first
+ For more information, see Working with XPath expressions.
+
+
+
+
+ What it does: ApplyXPathJAXP is similar to the ApplyXPath sample, but it uses the XPath API in &jaxp13-short;
+ to evaluate an XPath expression against an XML document and return the evaluation result in the specified type.
+ Run this sample from the XPathAPI subdirectory with
+ java ApplyXPathJAXP [XMLFile XPathExpression ReturnType]
+ where [XMLFile] is an XML source file, [XPathExpression] is an XPath expression to
+ apply to that file, and [ReturnType] is one of the strings from the list {"num", "bool", "str", "node", "nodeset"}
+ designating the return type of the evaluation. The XPathAPI subdirectory contains an XML file named
+ foo.xml. So you can try command lines like
+ java ApplyXPathJAXP foo.xml /doc/name[1]/@last str
+ and
+ java ApplyXPathJAXP foo.xml /doc/name nodeset
+
+
+
+
+ What it does: XPathResolver provides sample implementations of the NamespaceContext, XPathFunctionResolver
+ and XPathVariableResolver interfaces described in the
+ JAXP 1.3 XPath API .
+ The sample demonstrates how these implementations can be used to to evaluate XPath expressions that contain
+ extension functions and references to variables.
+ Run this sample from the XPathAPI subdirectory with
+ java XPathResolver
+
+
+
+
+ What it does: ExtensionFunctionResolver demonstrates how to use the sample implementation of XPathFunctionResolver to
+ evaluate XPath expressions containing Java or EXSLT extension functions.
+ To run this sample from the XPathAPI subdirectory, you need to compile ExtensionTest.java first and put
+ the XPathAPI directory on your classpath. Run the sample using
+ java ExtensionFunctionResolver
+
+
&xsltcsamples;
Index: xml-xalan/java/xdocs/sources/xalan/trax.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/trax.xml,v
retrieving revision 1.9
diff -u -r1.9 trax.xml
--- xml-xalan/java/xdocs/sources/xalan/trax.xml 26 Feb 2004 04:02:23 -0000 1.9
+++ xml-xalan/java/xdocs/sources/xalan/trax.xml 18 Jul 2005 02:15:31 -0000
@@ -16,7 +16,7 @@
* limitations under the License.
-->
-
+
-
-Output properties for XML, HTML, and Text transformation output are defined in property files in the org.apache.xml.serializer package.
-You can change these settings as follows:
+
+Output properties for XML, HTML, and text transformation output are defined in property files in the org.apache.xml.serializer package.
+You can override the default value of these properties in your stylesheet by using the attributes of an xsl:output element.
+You can override the Xalan specific default settings as follows:
Declare the xalan namespace in your stylesheet element (xmlns:xalan="http://xml.apache.org/xalan").
Use the namespace prefix you assign (for example, "xalan") to redefine properties of interest in the stylesheet xsl:output
@@ -127,7 +128,9 @@
indent="yes"
xalan:indent-amount="2"/>
If you want to change the property settings globally, edit the values in the property files in src/org/apache/xml/serializer,
- and use Ant to rebuild xalan.jar.
+ and use Ant to rebuild serializer.jar. Be aware that if you change the default value
+ of a standard property, such as the default encoding value, this may be in conflict with the default value specified by the XSLT 1.0
+ recommendation.
The properties files define the following properties:
[output_xml.properties]:
@@ -136,6 +139,30 @@
Default value
+ version
+ 1.0
+
+
+ encoding
+ UTF-8
+
+
+ indent
+ no
+
+
+ omit-xml-declaration
+ no
+
+
+ standalone
+ no
+
+
+ media-type
+ text/xml
+
+
xalan:indent-amount
0
@@ -145,12 +172,16 @@
xalan:entities
- XMLEntities
+ org/apache/xml/serializer/XMLEntities
+The xalan:content-handler property specifies the default name of the Java class that implements the
+org.xml.sax.ContentHandler
+interface and recieves calls during result tree serialization. If you specify an
+alternate Java class it must implement the ContentHandler interface.
You can also create your own XML entity file (mapping characters to
entities) or edit src/org/apache/xml/serializer/XMLEntities.properties and
-rebuild xalan.jar.
+rebuild serializer.jar.
[output_html.properties]:
@@ -158,6 +189,18 @@
Default value
+ version
+ 4.0
+
+
+ indent
+ yes
+
+
+ media-type
+ text/html
+
+
xalan:indent-amount
0
@@ -167,7 +210,7 @@
xalan:entities
- HTMLEntities
+ org/apache/xml/serializer/HTMLEntities
xalan:use-url-escaping
@@ -178,8 +221,12 @@
no
+The xalan:content-handler property specifies the default name of the Java class that implements the
+org.xml.sax.ContentHandler
+interface and recieves calls during result tree serialization. If you specify an
+alternate Java class it must implement the ContentHandler interface.
You can also create your own HTML entity file (mapping characters to entities)
-or edit src/org/apache/xml/serializer/HTMLEntities.properties and rebuild xalan.jar.
+or edit src/org/apache/xml/serializer/HTMLEntities.properties and rebuild serializer.jar.
[output_text.properties]:
@@ -187,10 +234,18 @@
Default value
+ media-type
+ text/plain
+
+
xalan:content-handler
org.apache.xml.serializer.ToTextStream
+The xalan:content-handler property specifies the default name of the Java class that implements the
+org.xml.sax.ContentHandler
+interface and recieves calls during result tree serialization. If you specify an
+alternate Java class it must implement the ContentHandler interface.
When you use the <xsl:output> encoding attribute to set output character encoding, you should not
@@ -237,7 +292,11 @@
-In some cases, you may want to "transform" a DOM tree into a stream, which the XML community calls serialization. TrAX (Transformation API for XML) and the &xslt4j; Transformer implementation provide direct support for this operation. Simply use the TransformerFactory newTransformer() method (no arguments) to create a Transformer that you can use to "copy" a DOMSource to a StreamResult. For examples, see Examples.exampleDOM2DOM(), Examples.exampleSerializeNode(), and Examples.exampleAsSerializer() in the trax sample.
+In some cases, you may want to "transform" a DOM tree into a stream, which the XML community calls serialization.
+ and the &xslt4j; Transformer implementation provide direct
+support for this operation. Simply use the TransformerFactory newTransformer() method (no arguments) to create a Transformer
+that you can use to "copy" a DOMSource to a StreamResult. For examples, see Examples.exampleDOM2DOM(),
+Examples.exampleSerializeNode(), and Examples.exampleAsSerializer() in the trax (JAXP transform) sample.
An XSLT stylesheet may include parameters that are set at run time each time a transformation is performed. To set a stylesheet parameter, use the Transformer
@@ -347,9 +406,14 @@
The DOM2DOM illustrates both procedures, and serializes the DOMResult to System.out.
-XSLT stylesheets use XPath expressions to select nodes, specify conditions, and generate text for the result tree. XPath provides an API that you can call directly. For example, you may want to select nodes programmatically and do your own processing without a stylesheet.
-XPath is an independent entity, with clients other than XSLT processors (such as XPointer). Accordingly, &xslt4j2; has packaged XPath as a separate module (org.apache.xpath and its subpackages), although currently this module does use some utility classes packaged in org.apache.xalan.utils. The org.apache.xpath.XPathAPI class contains convenience methods that you can use to return single DOM Nodes, NodeIterators, and XObjects. Apart from their own functionality, these methods also provide a path into the lower-level XPath API that you may find useful.
-For an example that uses the XPathAPI convenience methods to execute XPath expressions against XML source files, see ApplyXPath.
+XSLT stylesheets use XPath expressions to select nodes, specify conditions, and generate text for the result tree. XPath provides an API that you can call directly. For example, you may want to evaluate an XPath expression programmatically and do your own processing without a stylesheet.
+XPath is an independent entity, with clients other than XSLT processors (such as XPointer). Accordingly, &xslt4j2; has packaged XPath as a separate module (org.apache.xpath and its subpackages). The org.apache.xpath.XPathAPI class contains convenience methods that you can use to return single DOM Nodes, NodeIterators, and XObjects. Apart from their own functionality, these methods also provide a path into the lower-level XPath API that you may find useful.
+&jaxp13-short; also provides an API for xpath expression evaluation in the javax.xml.xpath package. Users are
+ recommended to use the new JAXP 1.3 XPath API rather than the old &xslt4j2; specific XPath API.
+For an example that uses the &xslt4j2; specific XPathAPI to execute XPath expressions against XML source files,
+see ApplyXPath. For examples on how to use the new JAXP 1.3 XPath
+API, see ApplyXPathJAXP and
+ XPathResolver.
@@ -362,7 +426,7 @@
<applet
name="xslControl"
code="org.apache.xalan.client.XSLTProcessorApplet.class"
- archive="../../bin/xalan.jar,../../bin/xml-apis.jar,../../bin/xercesImpl.jar"
+ archive="../../bin/xalan.jar,../../bin/serializer.jar,../../bin/xml-apis.jar,../../bin/xercesImpl.jar"
height="0"
width"0">
<param name="documentURL" value="xalanApplets.xml"/>
@@ -462,8 +526,8 @@
tree.
SelectionEvent is an event triggered by the
selection of a stylesheet node.
- ExtensionEvent is an event that is
- passed to the TraceListener.extension() function. It is called before an extension call is made.
+ ExtensionEvent is an event that is
+ passed to the TraceListener.extension() function. It is called before an extension call is made.
The command-line utility uses the debugger interface when you include one or more of the
following switches: -TT, -TG, -TS, -TTC.
Index: xml-xalan/java/xdocs/sources/xalan/whatsnew.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/whatsnew.xml,v
retrieving revision 1.32
diff -u -r1.32 whatsnew.xml
--- xml-xalan/java/xdocs/sources/xalan/whatsnew.xml 17 Feb 2004 19:25:35 -0000 1.32
+++ xml-xalan/java/xdocs/sources/xalan/whatsnew.xml 18 Jul 2005 02:15:33 -0000
@@ -17,65 +17,83 @@
-->
-&xslt4j; 2.5 contains the following new features:
-
- Integration of DTM into the Xalan Compiled processor (XSLTC)
- Integration of Xalan Interpretive and Xalan Compiled Serializers
-
-These new features have been driven by the need to have a closer integration
-and better code reuse between the Xalan Interpretive and the Xalan Compiled (XSLTC)
-processors. Prior to this release, the processors did not share much code and they
-had different underlying models for the input xml document. Xalan Interpretive used
-the Document Table Model (DTM) to model the input xml, while
-XSLTC used its own DOMImpl implementation. The serializers used by the processors were
-also different. As the project matures sharing more components between the processors
-becomes increasingly important. This will make the code more maintainable in the future and
-also eliminate some subtle behavioral differences between the Interpretive and the
-Compiled processors.
+
+
+
+ Support for JAXP 1.3 has been introduced in this release of &xslt4j;. JAXP 1.3
+ includes a new javax.xml.xpath package, which provides an object-model neutral
+ API for the evaluation of XPath expressions and access to the evaluation environment.
+ Please refer to Using the JAXP 1.3 XPath API for details on how to
+ use the new XPath API. You can also look at the code in the samples
+ ApplyXPathJAXP ,
+ XPathResolver and
+ ExtensionFunctionResolver.
+
+ There are also a few new transformer features
+ in JAXP 1.3, as described in the following list:
+
A new method
+
+ TransformerFactory.setFeature(String name, boolean value)
+ A new method
+ Transformer.reset()
+ A new nextSibling attribute is introduced for
+ DOMResult , accessible
+ by the constructors, getter and setter methods.
+ Support for the secure processing feature
+
+
+ The behavior of the default ErrorListener
+ was changed in this release of &xslt4j;,
+ in order to conform with a clarification of the required behavior described by JAXP 1.3.
+ If an application does not register its own ErrorListener, the default ErrorListener is
+ used which reports all warnings and errors to System.err and does not throw any Exceptions. Applications
+ are strongly encouraged to register and use ErrorListeners that insure proper behavior for warnings and errors.
+ The default ErrorListener of the old &xslt4ji; processor throws exceptions on errors and fatal errors. If your
+ code expects exceptions to be thrown on errors and fatal errors, you have to set a customized ErrorListener on
+ TransformerFactory and/or Transformer. You can use
+ org.apache.xml.utils.DefaultErrorHandler
+ as a sample ErrorListener implementation.
+
+
+ This release of &xslt4j; adds support for Namespaces in XML 1.1 and XML 1.1 output documents.
+ The processors:
+
support C0 control characters
+ handle C1 control characters in a way that is consistent with the requirements of XML 1.1
+ treat NEL (U+0085) and LSEP (U+2028) as end-of-line markers
+ support Internationalized Resource Identifiers (IRIs)
+ support the additional characters in NCNames and QNames permitted by XML 1.1 and Namespaces in XML 1.1
-In addition to these design benefits, the integration of DTM with XSLTC and the common
-serializer provide conformance and performance improvements to our users. In a practical
-environment, the performance improvement for most stylesheets in XSLTC is likely to be
-in the range of 10-20%. Stylesheets that use a lot of small result tree fragments (RTF) can
-be a few times faster because of the new light-weight RTF model. Although the performance
-improvement work focused mainly on the XSLTC side, the enhancements introduced also
-contributed to performance benefits for the Xalan Interpretive processor. As a result, the
-Interpretive processor is roughly 5-10% faster in this release.
-
-
-
-As of the &xslt4j; 2.5 release, both the Xalan Interpretive and Xalan Compiled (XSLTC)
-processors use the same Document Table Model (DTM). XSLTC's
-underlying document model, DOMImpl, was replaced with DTM and the original DTM was extended
-so that it could be used more efficiently with XSLTC. Many of the DOM-related classes in
-XSLTC were adapted to work with the new DTM model and only a few changes were made in the
-compiler-related classes. However, because of the changes in the core component, the
-translets generated by the XSLTC in this release are not binary compatible with the
-translets generated by previous releases of XSLTC (up to and including Xalan Java 2.5.D1).
-You'll need to recompile your stylesheets when you switch to this new release.
-
-
-
-
-As of the &xslt4j; 2.5 release, a common serializer is shared between the
-Xalan Interpretive and Xalan Compiled (XSLTC) processors. The common serializer
-code resides in the org.apache.xml.serializer package. The new serializer is
-designed to take the benefits of the old serialization mechanisms from both sides.
-By using the common serializer, many of the output differences between the
-Interpretive and the Compiled processor go away, and maintenance effort is
-reduced.
-During the merge of the Xalan Interpretive and XSLTC serializers, an
-effort was made to use the best performing features from each serializer.
-The new class hierarchy is similar to the one used by XSLTC. At the highest
-level the serializer classes split based on the output handler type
-("Stream" or "SAX"). At the next level, the hierarchy branches are based on
-the output type (XML, HTML or TEXT). This allows each flavor of serializer
-to do optimizations based on the output type and whether that output is going
-to a "Stream" or a "SAX" handler.
-From a functional point of view, the new serializer's output matches the
-behavior of the Interpretive processor's old serializer, such as the choice of
-which HTML entities to write out, and how to escape attribute values in
-documents written to a stream.
-
+ The processors do not undeclare namespaces other than the default namespace in serialized documents Also, Full
+ normalization is not supported.
+ An input document can be either XML 1.0 or XML 1.1. Also, a stylesheet document can be either XML 1.0 or XML 1.1.
+ A stylesheet document must conform to the XSLT 1.0 specifications.
+ Note that it is possible for a stylesheet module that is an XML 1.1 document to use constructs that cannot be
+ serialized as part of a valid XML 1.0 document, and for a stylesheet module that is an XML 1.0 document to use
+ constructs that cannot be serialized as part of a valid XML 1.1 document. For example, a stylesheet module that
+ is an XML 1.1 document might contain a literal result element whose name contains characters that are not permitted
+ as part of a QName in a document that conforms to Namespaces for XML 1.0. The user needs to ensure that the nodes
+ created by the stylesheet can be serialized as part of a well-formed document of the required version of XML.
+
+
+ Extensions written in Java are directly supported by &xslt4j;. For extensions written in languages other than
+ Java, &xslt4j; uses the Bean Scripting Framework (BSF), an architecture for incorporating scripting into Java
+ applications and applets, and an implementation of BSF must be available on the classpath. In previous
+ releases, IBM's BSF implementation (bsf.jar from 2001) has been included in the &xslt4j; distribution.
+ Some time ago IBM donated their BSF implementation to the
+ Apache Jakarta BSF project. As of this release,
+ the IBM bsf.jar is no longer included in the &xslt4j; distribution. To use extensions written in
+ languages other than Java, please download a version of Jakarta BSF and put it on your classpath. To use
+ a different BSF implementation, please refer to setting the BSFManager.
+
+
+ In this release of &xslt4j; the code related to serialization of output result trees has been pulled out of
+ xalan.jar and moved into a new jar file, named serializer.jar.
+ The code in serializer.jar has been modified to have no build or runtime dependencies on the rest of the
+ code in &xslt4j;, therefore, serializer.jar can be used in a stand-alone fashion through its public APIs.
+ Although the code has been modified to create a stand-alone jar, the serializer public APIs have not changed
+ and the package names and classnames are the same as they were last release.
+
+
Index: xml-xalan/java/xdocs/sources/xalan/xpath_apis.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/xpath_apis.xml,v
retrieving revision 1.1
diff -u -r1.1 xpath_apis.xml
--- xml-xalan/java/xdocs/sources/xalan/xpath_apis.xml 15 Jun 2005 15:16:15 -0000 1.1
+++ xml-xalan/java/xdocs/sources/xalan/xpath_apis.xml 18 Jul 2005 02:15:34 -0000
@@ -259,7 +259,7 @@
if (prefix.equals("ext"))
return "http://ext.com";
else
- return XMLConstants.NULL_NS_URI;
+ return null;
}
public String getPrefix(String namespace)
Index: xml-xalan/java/xdocs/sources/xalan/xsltc_usage.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/xsltc_usage.xml,v
retrieving revision 1.39
diff -u -r1.39 xsltc_usage.xml
--- xml-xalan/java/xdocs/sources/xalan/xsltc_usage.xml 3 Mar 2005 22:09:52 -0000 1.39
+++ xml-xalan/java/xdocs/sources/xalan/xsltc_usage.xml 18 Jul 2005 02:15:47 -0000
@@ -19,11 +19,11 @@
- Introduction
+ Introduction
Setting the system classpath for &xslt4jc-short;
Compiling translets from the command line
Running translets from the command line
- Calling &xslt4jc-short; with the TrAX/JAXP API
+ Calling &xslt4jc-short; with the JAXP API
Smart Transformer Switch
Calling &xslt4jc-short; with the native API
Usage constraints
@@ -34,29 +34,24 @@
Unless otherwise specified, the usage discussed in this section refers to
the &xslt4j; Compiling processor, XSLTC. See Basic Usage
Patterns for information on using the &xslt4j; Interpretive processor.
+
&xslt4jc-short; provides a compiler and a runtime processor.
Use the compiler to compile an XSL stylesheet into a translet (i.e., a set of
Java classes). Use the runtime processor to apply the translet to an XML
document and perform a transformation.
-To compile and run translets, you must have a JDK or a JRE 1.2 or
-higher.
-
-
+
-
-The jar file structure of the &xslt4jc-short; component has changed again. In the
-original structure, the xsltc.jar file contained only &xslt4jc-short; classes, so
-other support jar files needed to be added to the classpath.
-In a subsequent model, all of the support classes were bundled with the &xslt4jc-short;
-classes into one xsltc.jar file.
-Now, a single xalan.jar contains the code for both &xslt4j; processors. You
+
+
+The xalan.jar contains support for both &xslt4j; processors. You
can use the JAXP javax.xml.transform.TransformerFactory property
-(see "Calling &xslt4jc-short; with the TrAX/JAXP API" below) to
+(see "Calling &xslt4jc-short; with the JAXP API" below) to
select which processor to use: the Interpretive or the Compiling processor.
-Refer to the subsection 'Bundled System Classpath' below to learn more about
-the new bundling.
+To use XSLTC, simply put xalan.jar, serializer.jar, xml-apis.jar, and xercesImpl.jar on
+your classpath.
+To compile and run translets, you must use JDK (or JRE) 1.3.1 or higher.
Although the &xslt4jc-short; developers make every effort to avoid changes that
affect binary compatibility, we cannot guarantee that a translet will work with
any version of the run-time processor other than the one that corresponds to
@@ -65,14 +60,13 @@
-To use this newer approach, simply put xalan.jar, xml-apis.jar and xercesImpl.jar
-in your classpath. There is no need to include xsltc.jar, BCEL.jar, JLex.jar,
+To use this newer approach, simply put xalan.jar, serializer.jar, xml-apis.jar and
+xercesImpl.jar in your classpath. There is no need to include xsltc.jar, BCEL.jar, JLex.jar,
regexp.jar, java_cup.jar or runtime.jar as required in previous releases.
-In order to compile and run translets you must have a JAXP 1.2 compliant XML
+In order to compile and run translets you must have a JAXP 1.3 compliant XML
parser installed. Our distribution includes .
-Include xercesImpl.jar and xml-apis.jar in your class path.
-
+Include xercesImpl.jar and xml-apis.jar in your class path.
@@ -134,6 +128,7 @@
The translet is the set of class files or the JAR file that you generate with
the compiler; see Compiling translets.
+
@@ -153,15 +148,17 @@
You can also use the
&xslt4j; command-line utility , to
compile or run &xslt4jc-short; translets.
-
+
+
java org.apache.xalan.xsltc.cmdline.Compile
[-o <output>] [-d <directory>] [-j <jarfile>]
[-p <package name>] [-n] [-x] [-v] [-u] [-h]
{<stylesheet> | -i }
+
-
+
The following flags and arguments are supported:
@@ -213,7 +210,9 @@
http://example.org/my-stylesheet.xsl, the translet will actually
be named my_stylesheet.
-
+
+
+
The following examples assume that you have already set the
classpath to include the translet and the required JAR
@@ -250,7 +249,9 @@
Example 5 produces a set of class files such as com/mycompany/translets/hamlet.class,
com/mycompany/translets/hamlet$0.class', etc.
-
+
+
+
Synopsis
@@ -275,13 +276,15 @@
You can also use the
&xslt4j; Command-line Utility , to
compile or run &xslt4jc-short; translets.
+
java org.apache.xalan.xsltc.cmdline.Transform
- [-j <jarfile>] [-x] [-s] {-u <document_url> | <document>} <class>
+ [-j <jarfile>] [-x] {-u <document_url> | <document>} <class>
[<name1>=<value1> ...]
+
-
+
The following flags and arguments are supported:
@@ -310,7 +313,9 @@
may take a set of stylesheet parameters specified as
name-value pairs. The format for a name-value pair is
<name>=<value>.
-
+
+
+
The following examples assume that you have already set the classpath to include the translet and the required JAR
@@ -348,15 +353,19 @@
Example 3 applies the translet (hamlet) to the XML input document (http://zarya.east/test.xml hamlet). Inclusion of
the flag (-u) is optional.
-
-
+
+
+
+
&xslt4jc-short; TransformerFactory attributes
Examples
-&xslt4jc-short; translets are integrated with the TrAX/JAXP 1.2 API. See The Translet API & TrAX . Accordingly, it is now possible to set a system property and use a TransformerFactory to generate a Transformer that performs a transformation by compiling and running a translet.
+&xslt4jc-short; translets are integrated with the &jaxp13-short; API. Accordingly, it is now possible to set a
+system property and use a TransformerFactory to generate a Transformer that performs a transformation by compiling
+and running a translet.
-When you use the JAXP 1.2 API to run &xslt4j;, the
+
When you use the &jaxp13-short; API to run &xslt4j;, the
javax.xml.transform.TransformerFactory system property is set to
org.apache.xalan.processor.TransformerFactoryImpl. As it currently
stands, this &xslt4j; implementation of TransformerFactory always uses the &xslt4j;
@@ -368,7 +377,7 @@
Plugging in a Transformer and XML
parser.
-To use the JAXP 1.2 API to perform transformations with translets do the
+
To use the &jaxp13-short; API to perform transformations with translets do the
following:
Set the javax.xml.transform.TransformerFactory system
@@ -399,9 +408,12 @@
&xslt4jc-short; also defines a set of attributes that you can set on the
TransformerFactory in order to save and subsequently use those
translets by way of the JAXP Transform API - without having to recompile the
-stylesheet each time.
+stylesheet each time.
+
+
-The JAXP Transform API defines a TransformerFactory.setAttribute
+The JAXP Transform API defines a
+TransformerFactory.setAttribute
method that you can use to set implementation-defined attributes.
@@ -475,7 +487,9 @@
underscore. For example, if the translet name specified was
my-stylesheet, the translet will actually be named
my_stylesheet.
-
+
+
+
Example 1: Using a translet/Templates object for multiple
concurrent transformations
@@ -550,13 +564,14 @@
For a working sample that illustrates this usage pattern, see JAXPTransletMultipleTransformations.
+
-As part of the TrAX API, a "Smart Transformer Switch" enables automatic switching
+
As part of the JAXP API, a "Smart Transformer Switch" enables automatic switching
between &xslt4ji; and &xslt4jc-short; processors within your application. It uses &xslt4ji;
processor to create your Transformer objects, and uses &xslt4jc-short; to create your
Templates objects.
-To use the switch, you set the TrAX system property,
+
To use the switch, you set the JAXP system property,
javax.xml.transform.TransformerFactory, to
org.apache.xalan.xsltc.trax.SmartTransformerFactoryImpl.
For one-time transformations or transformations that require extensions
@@ -566,11 +581,13 @@
create a Templates object from which you would create your
Transformer objects.
+
The &xslt4jc-short; Native API is no longer supported. Instead, you should always
use &xslt4jc-short; with the JAXP Transform API.
+
@@ -583,7 +600,7 @@
methods for each template. Inlining was thought to improve performance,
but with recent hotspot technology in the Java 1.4.x JVM, performance is better with
inlining off. From the command line, you would use "-n"
- to turn on inlining, or with TrAX set the "enable-inlining" attribute to the TransformerFactory.
+ to turn on inlining, or with JAXP set the "enable-inlining" attribute to the TransformerFactory.
For example,
TransformerFactory tfac = new TransformerFactory();
tfac.setAttribute("enable-inlining", Boolean.TRUE);