mkwan 2003/02/04 12:42:41
Modified: java/xdocs/sources/xalan Tag: XSLTC_DTM extensions.xml
samples.xml
Log:
xdocs update
In samples.xml, update the documentation for the ApplyXSLT sample to provide
more information about the input xml and stylesheet.
In extensions.xml, add documentation for the src attribute in xalan:script.
Revision Changes Path
No revision
No revision
1.21.4.2 +5 -2 xml-xalan/java/xdocs/sources/xalan/extensions.xml
Index: extensions.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/extensions.xml,v
retrieving revision 1.21.4.1
retrieving revision 1.21.4.2
diff -u -r1.21.4.1 -r1.21.4.2
--- extensions.xml 27 Jan 2003 19:46:26 -0000 1.21.4.1
+++ extensions.xml 4 Feb 2003 20:42:40 -0000 1.21.4.2
@@ -193,7 +193,7 @@
<p>To run the preceding example, bsf.jar and js.jar must be on the
classpath. Remember that bsf.jar must be on the classpath to run any extension
written in a language other than Java. For extensions implemented in a
scripting language, see the additional requirements in <link
anchor="supported-lang">Supported languages</link>.</p>
</s2><anchor name="basic-syntax"/>
<s2 title="Syntax">
-<p>You can always use the pattern illustrated above to set up and use
extension elements and extension functions. For extension elements and
functions implemented in Java, you can also use an abbreviated syntax,
described in <link anchor="java-namespace">Alternative: using the abbreviated
syntax for extensions implemented in Java</link>. Unless you are using the
abbreviated syntax, do the following:</p>
+<p>You can always use the pattern illustrated above to set up and use
extension elements and extension functions. For extension elements and
functions implemented in Java, it is recommended that you use the abbreviated
syntax, described in <link anchor="java-namespace">Alternative: using the
abbreviated syntax for extensions implemented in Java</link>. Unless you are
using the abbreviated syntax, do the following:</p>
<s3 title="1. Declare the xalan namespace">
<p><br/><code>xmlns:xalan="http://xml.apache.org/xalan"</code></p>
<p>The xalan namespace provides support for the xalan:component element and
xalan:script subelement.</p>
@@ -235,7 +235,10 @@
<p><code><xalan:script lang="javascript" ></code><br/>
<code> <!--The implementation script--></code><br/>
<code></xalan:script></code></p>
-<p>For other scripting languages supported by BSF, use the same approach as
for JavaScript. &xslt4j; plans to add support for using the src attribute to
identify another document that contains the implementation script; this feature
is not yet supported.</p>
+<p>For other scripting languages supported by BSF, use the same approach as
for JavaScript.
+The src attribute is also supported in the xalan:script element. If it is
present, the script will
+be loaded from the URL specified in the src attribute. Otherwise the script
is taken from the text child
+of the xalan:script element.</p>
<p>If the extension is implemented in Java, you have three choices for the
format of the src attribute in the xalan:script element.</p>
<p><code><xalan:script lang="javaclass"
src="xalan://<ref>FQCN</ref>"/></code>
<br/>where <ref>FQCN</ref> is the fully qualified class name.
1.48.4.3 +18 -14 xml-xalan/java/xdocs/sources/xalan/samples.xml
Index: samples.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/samples.xml,v
retrieving revision 1.48.4.2
retrieving revision 1.48.4.3
diff -u -r1.48.4.2 -r1.48.4.3
--- samples.xml 28 Jan 2003 21:40:01 -0000 1.48.4.2
+++ samples.xml 4 Feb 2003 20:42:41 -0000 1.48.4.3
@@ -285,27 +285,31 @@
<p>To run the servlet: put xalanservlet.jar on the servlet engine
classpath, configure your servlet engine so it can find the
stylesheets and properties file in the servlet subdirectory (and in
xalanservlet.jar), and set up an HTML page to call
servlet.ApplyXSLT with arguments as illustrated below.</p>
+ <p>The files foo.xml and foo.xsl used in the following example are
created by the user. Good
+ examples for these files are birds.xml/birds.xsl and foo.xml/foo.xsl
under the SimpleTransform
+ sample. If you create these files yourself, be careful that the output
method should
+ be set to "xml" in the stylesheet.</p>
<p>Examples:</p>
<gloss>
-<label>http://localhost/servlethome/servlet.ApplyXSLT?URL=/data.xml&xslURL=
-/style.xsl</label>
-<item>...applies the style.xsl stylesheet to the data.xml data. Both files
are<br/>
+<label>http://localhost/servlethome/servlet.ApplyXSLT?URL=/foo.xml&xslURL=
+/foo.xsl</label>
+<item>...applies the foo.xsl stylesheet to the foo.xml data. Both files
are<br/>
served from the Web server's HTTP document root.<br/><br/></item>
-<label>http://localhost/servlethome/servlet.ApplyXSLT?URL=/data.xml&xslURL=
-/style.xsl&debug=true</label>
+<label>http://localhost/servlethome/servlet.ApplyXSLT?URL=/foo.xml&xslURL=
+/foo.xsl&debug=true</label>
<item>...ensures that XML and XSL processor messages are returned in the
event of problems
-applying style.xsl to data.xml<br/><br/></item>
-<label>http://localhost/servlethome/servlet.ApplyXSLT/data.xml?xslURL=/style.xsl</label>
-<item>...applies the style.xsl stylesheet to the data.xml data, just like
the first example.
+applying foo.xsl to foo.xml<br/><br/></item>
+<label>http://localhost/servlethome/servlet.ApplyXSLT/foo.xml?xslURL=/foo.xsl</label>
+<item>...applies the foo.xsl stylesheet to the foo.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.<br/><br/></item>
-<label>http://localhost/servlethome/servlet.ApplyXSLT/data.xml</label>
-<item>...examines data.xml for an associated XSL stylesheet (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.<br/><br/></item>
-<label>http://localhost/servlet/data.xml</label>
+<label>http://localhost/servlethome/servlet.ApplyXSLT/foo.xml</label>
+<item>...examines foo.xml for an associated XSL stylesheet (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.<br/><br/></item>
+<label>http://localhost/servlet/foo.xml</label>
<item>...provides the same function as the previous example, but this
example assumes
-that /servlet/data.xml has been mapped to be executed by this servlet. The
servlet engine may be configured
+that /servlet/foo.xml has been mapped to be executed by this servlet. The
servlet engine may be configured
to map all or some *.xml files to this servlet through the use of servlet
aliases or filters.<br/><br/></item>
-<label>http://localhost/servlet/data.xml?catalog=http://www.xml.org/dtds/oag.xml</label>
+<label>http://localhost/servlet/foo.xml?catalog=http://www.xml.org/dtds/oag.xml</label>
<item>...supplements any servlet-configured XCatalog
with a catalog of supply chain DTDs residing at the XML.ORG DTD
repository.</item>
</gloss>
@@ -536,4 +540,4 @@
<p><code>java Examples</code></p>
<p>and examine the source in Examples.java and
ExampleContentHandler.java.</p>
</s2>&xsltcsamples;
-</s1>
+</s1>
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]