dleslie 02/01/30 14:23:13
Modified: java/xdocs/sources xalan-jlocal.xml xalan-jsite.xml
java/xdocs/sources/xalan commandline.xml extensionslib.xml
faq.xml features.xml usagepatterns.xml
Log:
Updates for 2.3
Revision Changes Path
1.21 +1 -1 xml-xalan/java/xdocs/sources/xalan-jlocal.xml
Index: xalan-jlocal.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan-jlocal.xml,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- xalan-jlocal.xml 30 Jan 2002 14:23:52 -0000 1.20
+++ xalan-jlocal.xml 30 Jan 2002 22:23:12 -0000 1.21
@@ -73,7 +73,7 @@
<document id="commandline" label="Command Line"
source="xalan/commandline.xml"/>
<separator/>
<document id="usagepatterns" label="Usage Patterns"
source="xalan/usagepatterns.xml"/>
- <hidden id="features" source="xalan/features.xml"/>
+ <document id="features" label="Features" source="xalan/features.xml"/>
<separator/>
<document id="trax" label="TrAX" source="xalan/trax.xml"/>
<external href="apidocs/index.html" label="API (Javadoc)"/>
1.39 +1 -1 xml-xalan/java/xdocs/sources/xalan-jsite.xml
Index: xalan-jsite.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan-jsite.xml,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- xalan-jsite.xml 30 Jan 2002 14:23:52 -0000 1.38
+++ xalan-jsite.xml 30 Jan 2002 22:23:12 -0000 1.39
@@ -76,7 +76,7 @@
<document id="commandline" label="Command Line"
source="xalan/commandline.xml"/>
<separator/>
<document id="usagepatterns" label="Usage Patterns"
source="xalan/usagepatterns.xml"/>
- <hidden id="features" source="xalan/features.xml"/>
+ <document id="features" label="Features" source="xalan/features.xml"/>
<separator/>
<document id="trax" label="TrAX" source="xalan/trax.xml"/>
<external href="apidocs/index.html" label="API (Javadoc)"/>
1.19 +4 -3 xml-xalan/java/xdocs/sources/xalan/commandline.xml
Index: commandline.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/commandline.xml,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- commandline.xml 30 Jan 2002 14:23:52 -0000 1.18
+++ commandline.xml 30 Jan 2002 22:23:12 -0000 1.19
@@ -85,7 +85,6 @@
-V (Version info)
-QC (Quiet Pattern Conflicts Warnings)
--L (Report line numbers for problems with source document)
-TT (Trace the templates as they are being called)
-TG (Trace each result tree generation event)
-TS (Trace each selection event)
@@ -107,8 +106,7 @@
false)
-RL recursionLimit (Set numeric limit on depht of stylesheet
recursion)
--L (Obtain a SourceLocator that can be used within stylesheet to
- report location of nodes within the XML source document)
+-L (Turn on source-location attribute)
</source>
<p>Use <code>-IN</code> to specify the XML source document.</p>
<p>Use <code>-XSL</code> to specify the XSL stylesheet file.</p>
@@ -120,6 +118,9 @@
<code>java org.apache.xalan.xslt.Process -PARAM <ref>name
value</ref></code></p>
<p>The value is passed to the transformer as a String.</p>
<p>For information about incremental and optimized stylesheet
processing, see <link idref="dtm" anchor="settings">DTM settings</link>.</p>
+ <p>Use <code>-L</code> to obtain access to a SourceLocator that a
stylesheet extension can use to get information about the location
+ of nodes in the source document. For more information, see <link
idref="extensionslib" anchor="nodeinfo">NodeInfo extension functions</link>
+ and <link idref="features"
anchor="source-location">source-location</link>.</p>
<p>Use <code>-URIRESOLVER</code> with a fully qualified class name to
utilize a custom implementation of the
<jump
href="apidocs/javax/xml/transform/URIResolver.html">URIResolver</jump> TrAX
interface to resolve URIs for
xsl:include, xsl:import, and the document() function.</p>
1.21 +24 -13 xml-xalan/java/xdocs/sources/xalan/extensionslib.xml
Index: extensionslib.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/extensionslib.xml,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- extensionslib.xml 30 Jan 2002 14:23:52 -0000 1.20
+++ extensionslib.xml 30 Jan 2002 22:23:12 -0000 1.21
@@ -66,10 +66,7 @@
<li><link anchor="difference">difference</link></li>
<li><link anchor="distinct">distinct</link></li>
<li><link anchor="hassamenodes">hasSameNodes</link></li>
-<li><link anchor="systemid">systemId</link></li>
-<li><link anchor="publicid">publicId</link></li>
-<li><link anchor="linenumber">lineNumber</link></li>
-<li><link anchor="columnnumber">columnNumber</link></li>
+<li><link anchor="nodeinfo">NodeInfo extension functions</link></li>
<li><link anchor="sql">SQL library</link></li>
<li><link anchor="pipedocument">PipeDocument</link></li>
<li><link anchor="evaluate">evaluate</link></li>
@@ -217,27 +214,41 @@
<s2 title= "hasSameNodes">
<p>Implemented in <jump
href="apidocs/org/apache/xalan/lib/Extensions.html">org.apache.xalan.lib.Extensions</jump>,<br/>
<code>hasSameNodes(node-set1, node-set2)</code> returns true if both
node-set1 and node-set2 contain exactly the same set of nodes.</p>
-</s2><anchor name="systemid"/><anchor name="nodeinfo"/>
-<s2 title="systemId">
+</s2><anchor name="nodeinfo"/>
+<s2 title="NodeInfo">
+<p><jump
href="apidocs/org/apache/xalan/lib/NodeInfo.html">org.apache.xalan.lib.NodeInfo</jump>
provides extension elements that you can
+use to get information about the location of nodes in the source
document:</p>
+<ul>
+<li><link anchor="systemid">systemId</link></li>
+<li><link anchor="publicid">publicId</link></li>
+<li><link anchor="linenumber">lineNumber</link></li>
+<li><link anchor="columnnumber">columnNumber</link></li>
+</ul>
+<note>If you want to use the NodeInfo extension elements, you MUST set the
TransformerFactory
+<link idref="features" anchor="source-location">source-location</link>
attribute to Boolean.TRUE.
+You can use the <link idref="commandline">command-line utility</link> -L
flag or the <jump
href="apidocs/javax/xml/transform/TransformerFactory.html#setAttribute(java.lang.String,
java.lang.Object)">TransformerFactory.setAttribute()</jump>
+method to set this attribute.</note>
+<anchor name="systemid"/>
+<s3 title="systemId">
<p>Implemented in <jump
href="apidocs/org/apache/xalan/lib/NodeInfo.html">org.apache.xalan.lib.NodeInfo</jump>,<br/>
<code>systemId()</code> returns the system ID for the current node, and <br/>
<code>systemId(node-set)</code> returns the system ID of the first node in
the node-set.</p>
-</s2><anchor name="publicid"/>
-<s2 title="publicId">
+</s3><anchor name="publicid"/>
+<s3 title="publicId">
<p>Implemented in <jump
href="apidocs/org/apache/xalan/lib/NodeInfo.html">org.apache.xalan.lib.NodeInfo</jump>,<br/>
<code>publicId()</code> returns the public ID for the current node, and<br/>
<code>publicId(node-set)</code> returns the public ID of the first node in
the node-set.</p>
-</s2><anchor name="linenumber"/>
-<s2 title="lineNumber">
+</s3><anchor name="linenumber"/>
+<s3 title="lineNumber">
<p>Implemented in <jump
href="apidocs/org/apache/xalan/lib/NodeInfo.html">org.apache.xalan.lib.NodeInfo</jump>,<br/>
<code>lineNumber()</code> returns the line number in the source document for
the current node, and<br/>
<code>lineNumber(node-set)</code> returns the line number in the source
document for the first node in the node-set.</p>
-</s2><anchor name="columnnumber"/>
-<s2 title="columnNumber">
+</s3><anchor name="columnnumber"/>
+<s3 title="columnNumber">
<p>Implemented in <jump
href="apidocs/org/apache/xalan/lib/NodeInfo.html">org.apache.xalan.lib.NodeInfo</jump>,<br/>
<code>columnNumber()</code> returns the column number in the source document
for the current node, and<br/>
<code>columnNumber(node-set)</code> returns the column number in the source
document for the first node in the node-set.</p>
-</s2><anchor name="sql"/>
+</s3></s2><anchor name="sql"/>
<s2 title= "SQL library">
<note>For UML Diagrams of the SQL Library, see <jump
href="http://xml.apache.org/xalan-j/Xalan-SQL-Extension/DiagramIndex.html">SQL
Library UML Diagrams</jump>.</note>
<ul>
1.19 +27 -1 xml-xalan/java/xdocs/sources/xalan/faq.xml
Index: faq.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/faq.xml,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- faq.xml 30 Jan 2002 16:04:13 -0000 1.18
+++ faq.xml 30 Jan 2002 22:23:12 -0000 1.19
@@ -298,4 +298,30 @@
<p>Note too that on some platforms 1MB is an architectural upper limit on
the stack size, so setting -Xss2m (or equivalent) may not allow deeper recusion
than -Xss1m.</p>
</a>
</faq>
-</faqs>
+<faq title="OutOfMemoryError processing multiple documents">
+<q>I get a java.lang.OutOfMemoryError when I try to process multiple
documents with the document() function. What can I do?</q>
+<a>
+<p>As a general rule, &xslt4j; currently caches all of the documents that
you read in with the document() function during a transformation.</p>
+<p>If your objective is to transform a series of documents, you can break
the process into a series of transformations.
+The <link idref="extensionslib" anchor="pipedocument">PipeDocument</link>
extension element provides one strategy for batching a
+series of parallel transformations.</p>
+<p>Another alternative is to place your document() call in the select
attribute of an xsl:for-each instruction element
+and use a custom PI (Processing Instruction) to turn off document caching.
Include an XPath expression in your document() call if you do not
+need to process the entire document.</p>
+<p>Sample stylesheet fragment:</p>
+<source>
+<xsl:template match="doc">
+ <xsl:for-each select="document(@href)/bar/zulu">
+ <?xalan:doc-cache-off?>
+ <!-- process each document -->
+ <xsl:for-each>
+</xsl:template></source>
+<note>PIs do not ordinarily uses namespaces, so "xalan:" is a 'fake'
namespace we have included to indicate that this is not a standard PI.</note>
+<p>If you include an XPath expression in your document() call, you can also
turn on <link idref="dtm" anchor="incremental">incremental transform</link>
+to eliminate the need to read in the entire document. In fact, you can take
advantage of the incremental transform feature even if you are not turning
+off document caching.</p>
+<p>You can also increase your jvm heap size with the -Xmx or -mx flag,
depending on which JVM you are using (you can include both flags, and the JVM
will ignore the one it doesn't understand). For example, to give your JVM 64
meg, try <br/>
+<code> java -Xmx64m -mx64m <ref>Class</ref></code></p>
+</a>
+</faq>
+</faqs>
\ No newline at end of file
1.2 +43 -43 xml-xalan/java/xdocs/sources/xalan/features.xml
Index: features.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/features.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- features.xml 30 Jan 2002 14:23:52 -0000 1.1
+++ features.xml 30 Jan 2002 22:23:12 -0000 1.2
@@ -1,32 +1,31 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
<s1 title="Transform Features">
-<p>Transform features include standard JAXP 1.1 behaviors that your
implementation may support (&xslt4j; supports all such behaviors), general
session-level &xslt4j;-defined behaviors that you can set, and &xslt4j;-defined
behaviors that you can set for an individual transformation. Transform features
are identified by URI Strings and fall into the following categories:</p>
+<p>Transform features are identified by URI Strings and fall into the
following categories:</p>
<ul>
<li><link anchor="factoryfeature">Standard TransformationFactory
features</link></li>
-<li><link anchor="factoryattribute">&xslt4j; TransformerFactory
attributes</link></li>
-<li><link anchor="transformerproperty">&xslt4j; Transformer
properties</link></li>
+<li><link anchor="factoryattribute">Implementation-specific
TransformerFactory attributes</link></li>
</ul>
<anchor name="factoryfeature"/>
<s2 title="Standard TransformerFactory features">
<p>The JAXP 1.1 Transformation API for XML (<link idref="trax">TrAX</link>)
defines objects and methods for processing input and producing output in a
variety of formats, including character streams, SAX event streams, and DOM
Documents.</p>
<p>JAXP 1.1 defines the following feature URIs:</p>
<ul>
-<li><link
anchor="streamsource">"http://xml.apache.org.stream.StreamSource/feature"</link></li>
-<li><link
anchor="streamresult">"http://xml.apache.org.stream.StreamResult/feature"</link></li>
-<li><link
anchor="domsource">"http://xml.apache.org.dom.DOMSource/feature"</link></li>
-<li><link
anchor="domresult">"http://xml.apache.org.dom.DOMResult/feature"</link></li>
-<li><link
anchor="saxsource">"http://xml.apache.org.dom.SAXSource/feature"</link></li>
-<li><link
anchor="saxresult">"http://xml.apache.org.dom.SAXResult/feature"</link></li>
-<li><link
anchor="saxtransformerfactory">"http://xml.apache.org.sax.SAXTransformerFactory/feature"</link></li>
-<li><link
anchor="xmlfilter">"http://xml.apache.org.sax.SAXTransformerFactory/feature/xmlfilter"</link></li>
+<li><link
anchor="streamsource">"http://javax.xml.transform.stream.StreamSource/feature"</link></li>
+<li><link
anchor="streamresult">"http://javax.xml.transform.stream.StreamResult/feature"</link></li>
+<li><link
anchor="domsource">"http://javax.xml.transform.dom.DOMSource/feature"</link></li>
+<li><link
anchor="domresult">"http://javax.xml.transform.dom.DOMResult/feature"</link></li>
+<li><link
anchor="saxsource">"http://javax.xml.transform.dom.SAXSource/feature"</link></li>
+<li><link
anchor="saxresult">"http://javax.xml.transform.dom.SAXResult/feature"</link></li>
+<li><link
anchor="saxtransformerfactory">"http://javax.xml.transform.sax.SAXTransformerFactory/feature"</link></li>
+<li><link
anchor="xmlfilter">"http://javax.xml.transform.sax.SAXTransformerFactory/feature/xmlfilter"</link></li>
</ul>
<p>You can use the
<jump
href="apidocs/javax/xml/transform/TransformerFactory.html#getFeature(java.lang.String)">TransformerFactory.getFeature(String)</jump>
method to return a boolean indicating whether the implementation you are
using supports the use of one of these objects or methods. For the String
argument, provide the static String variable or literal URI String as detailed
below.</p>
<p>&xslt4j; supports <em>all</em> TransformerFactory features.</p>
<anchor name="streamsource"/>
-<s3 title='"http://xml.apache.org.stream.StreamSource/feature"'>
+<s3 title='"http://javax.xml.transform.stream.StreamSource/feature"'>
<p>The implementation supports the processing of <jump
href="apidocs/javax/xml/transform/stream/StreamSource.html">StreamSource</jump>
input objects.</p>
<p>To determine whether your implementation supports this feature (&xslt4j;
does), you can use the static StreamSource.FEATURE variable (equivalent to the
URI String above) as follows:</p>
<source>import javax.xml.transform.TransformerFactory;
@@ -37,20 +36,22 @@
// Can process a StreamSource.
..
}</source>
+<p>For a example that uses this feature, see <link idref="samples"
anchor="simpletransform">SimpleTransform</link>.</p>
</s3><anchor name="streamresult"/>
-<s3 title='"http://xml.apache.org.stream.StreamResult/feature"'>
+<s3 title='"http://javax.xml.transform.stream.StreamResult/feature"'>
<p>The implementation supports the production of transformation output in
the form of <jump
href="apidocs/javax/xml/transform/stream/StreamResult.html">StreamResult</jump>
objects.</p>
<p>To determine whether your implementation supports this feature (&xslt4j;
does), you can use the static StreamResult.FEATURE variable (equivalent to the
URI String above) as follows:</p>
<source>import javax.xml.transform.TransformerFactory;
-import javax.xml.stream.StreamSource;
+import javax.xml.stream.StreamResult;
..
TransformerFactory tFact = TransformerFactory.newInstance();
if (tFact.getFeature(StreamResult.FEATURE)){
// Can generate a StreamResult.
..
}</source>
+<p>For a example that uses this feature, see <link idref="samples"
anchor="simpletransform">SimpleTransform</link>.</p>
</s3><anchor name="domsource"/>
-<s3 title='"http://xml.apache.org.dom.DOMSource/feature"'>
+<s3 title='"http://javax.xml.transform.dom.DOMSource/feature"'>
<p>The implementation supports the processing of XML input in the form of
<jump href="apidocs/javax/xml/transform/dom/DOMSource.html">DOMSource</jump>
objects.</p>
<p>To determine whether your implementation supports this feature (&xslt4j;
does), you can use the static DOMSource.FEATURE string variable (equivalent to
the URI String above) as follows:</p>
<source>import javax.xml.transform.TransformerFactory;
@@ -61,8 +62,9 @@
// Can process DOM input
..
}</source>
+<p>For a example that uses this feature, see <link idref="samples"
anchor="dom2dom">DOM2DOM</link>.</p>
</s3><anchor name="domresult"/>
-<s3 title='"http://xml.apache.org.dom.DOMResult/feature"'>
+<s3 title='"http://javax.xml.transform.dom.DOMResult/feature"'>
<p>The implementation supports the production of transformation output in
the form of <jump
href="apidocs/javax/xml/transform/dom/DOMResult.html">DOMResult</jump>
objects.</p>
<p>To determine whether your implementation supports this feature (&xslt4j;
does), you can use the static DOMResult.FEATURE variable (equivalent to the
URI String above) as follows:</p>
<source>import javax.xml.transform.TransformerFactory;
@@ -73,8 +75,9 @@
// Can generate DOM output.
..
}</source>
+<p>For a example that uses this feature, see <link idref="samples"
anchor="dom2dom">DOM2DOM</link>.</p>
</s3><anchor name="saxsource"/>
-<s3 title='"http://xml.apache.org.dom.SAXSource/feature"'>
+<s3 title='"http://javax.xml.transform.dom.SAXSource/feature"'>
<p>The implementation supports the processing of XML input in the form of
<jump href="apidocs/javax/xml/transform/sax/SAXSource.html">SAXSource</jump>
objects.</p>
<p>To determine whether your implementation supports this feature (&xslt4j;
does), you can use the static SAXSource.FEATURE string variable (equivalent to
the URI String above) as follows:</p>
<source>import javax.xml.transform.TransformerFactory;
@@ -86,7 +89,7 @@
..
}</source>
</s3><anchor name="saxresult"/>
-<s3 title='"http://xml.apache.org.dom.SAXResult/feature"'>
+<s3 title='"http://javax.xml.transform.dom.SAXResult/feature"'>
<p>The implementation supports the production of transformation output in
the form of <jump
href="apidocs/javax/xml/transform/sax/SAXResult.html">SAXResult</jump>
objects.</p>
<p>To determine whether your implementation supports this feature (&xslt4j;
does), you can use the static SAXResult.FEATURE variable (equivalent to the
URI String above) as follows:</p>
<source>import javax.xml.transform.TransformerFactory;
@@ -97,8 +100,9 @@
// Can output SAX events.
..
}</source>
+<p>For a example that uses this feature, see <link idref="samples"
anchor="sax2sax">SAX2SAX</link>.</p>
</s3><anchor name="saxtransformerfactory"/>
-<s3 title='"http://xml.apache.org.sax.SAXTransformerFactory/feature"'>
+<s3 title='"http://javax.xml.transform.sax.SAXTransformerFactory/feature"'>
<p>The implementation provides a <jump
href="apidocs/javax/xml/transform/sax/SAXTransformerFactory.html">SAXTransformerFactory</jump>.
You may safely cast
the TransformerFactory returned by TransformerFactory.newInstance() to a
SAXTransformerFactory.</p>
<p>To determine whether your implementation supports this feature (&xslt4j;
does), you can use the static SAXTransformerFactory.FEATURE variable
@@ -111,8 +115,9 @@
SAXTransformerFactory saxTFact = (SAXTransformerFactory)tFact;
..
}</source>
+<p>For a example that uses this feature, see <link idref="samples"
anchor="sax2sax">SAX2SAX</link>.</p>
</s3><anchor name="xmlfilter"/>
-<s3
title='"http://xml.apache.org.sax.SAXTransformerFactory/feature/xmlfilter"'>
+<s3
title='"http://javax.xml.transform.sax.SAXTransformerFactory/feature/xmlfilter"'>
<p>The implementation supports the use of <jump
href="apidocs/org/xml/sax/XMLFilter.html">XMLFilter</jump> to use the output of
one transformation as input for another transformation. The
SAXTransformerFactory newXMLFilter(Source) and newXMLFilter(Templates) methods
are supported.</p>
<p>To determine whether your implementation supports this feature (&xslt4j;
does), you can use the static SAXTransformerFactory.FEATURE_XMLFilter variable
(equivalent to the URI String above) as follows:</p>
@@ -129,14 +134,16 @@
</s2><anchor name="factoryattribute"/>
<s2 title="&xslt4j; TransformerFactory attributes">
<p>A given implementation may provide TransformerFactory attributes that you
can set and get. &xslt4j; uses the <link idref="dtm">
-DTM (Document Table Model)</link> to support two such attributes:</p>
+DTM (Document Table Model)</link> to support three such attributes:</p>
<ul>
<li><link
anchor="optimize">"http://apache.org/xalan/features/optimize"</link></li>
<li><link
anchor="incremental">"http://apache.org/xalan/features/incremental"</link></li>
+<li><link
anchor="source-location">"http://apache.org/xalan/features/source-location"</link></li>
</ul>
-<p>To get an attribute setting, use the
TransformerFactory.getAttribute(String) method, which returns an Object that
(for these two &xslt4j; attributes) you can cast to a boolean. To set an
attribute, use the TransformerFactory.setAttribute(String, Object) method. For
the String argument, provide the static String variable or literal URI String
as detailed below. For the Object argument, use Boolean.TRUE or
Boolean.FALSE.</p><anchor name="optimize"/>
+<p>To get an attribute setting, use the
TransformerFactory.getAttribute(String) method, which returns an Object. For
these three &xslt4j;
+attributes, you can cast the return value to a boolean. To set an attribute,
use the TransformerFactory.setAttribute(String, Object) method. For the String
argument, provide the static String variable or literal URI String as detailed
below. For the Object argument, use Boolean.TRUE or Boolean.FALSE.</p><anchor
name="optimize"/>
<s3 title='"http://apache.org/xalan/features/optimize"'>
-<p>Optimize stylesheet processing. By default, this attribute is on. You may
need to turn it off for tooling applications. For more information, see <link
idref="dtm" anchor="incremental">incremental transforms</link>.</p>
+<p>Optimize stylesheet processing. By default, this attribute is on. You may
need to turn it off for tooling applications. For more information, see <link
idref="dtm" anchor="optimize">optimize</link>.</p>
<p>To turn optimization off, you can use the
TransformerFactoryImpl.FEATURE_OPTIMIZE static variable (equivalent to the URI
String above) as follows:</p>
<source>import javax.xml.transform.TransformerFactory;
import org.apache.xalan.processor.TransformerFactoryImpl;
@@ -148,7 +155,7 @@
}</source>
</s3><anchor name="incremental"/>
<s3 title='"http://apache.org/xalan/features/incremental"'>
-<p>Produce output incrementally, rather than waiting to finish parsing the
input before generating any output. By default this attribute is off. You can
turn this attribute on to transform large documents where the stylesheet
structure is optimized to execute individual templates without having to parse
scattered sections of the document. For more information, see <link idref="dtm"
anchor="optimized">optimized transforms</link>.</p>
+<p>Produce output incrementally, rather than waiting to finish parsing the
input before generating any output. By default this attribute is off. You can
turn this attribute on to transform large documents where the stylesheet
structure is optimized to execute individual templates without having to parse
scattered sections of the document. For more information, see <link idref="dtm"
anchor="incremental">incremental</link>.</p>
<p>To turn incremental transformations on, you can use the
TransformerFactoryImpl.FEATURE_INCREMENTAL static variable (equivalent to the
URI String above) as follows:</p>
<source>import javax.xml.transform.TransformerFactory;
import org.apache.xalan.processor.TransformerFactoryImpl;
@@ -158,30 +165,23 @@
tFact.setAttribute(TransformerFactoryImpl.FEATURE_INCREMENTAL,
Boolean.FALSE);
}</source>
-</s3>
-</s2><anchor name="transformerproperty"/>
-<s2 title="&xslt4j; Transformer property">
-<p>A Transformer implementation may provide runtime properties that you can
set. The JAXP Transformer API provides no method for getting and setting
Transformer properties, so you must use the implementation API. The &xslt4j;
org.apache.xalan.transformer.TransformerImpl supports one such property:</p>
-<ul><li><link
anchor="source-location">"http://apache.org/xalan/properties/source-location"</link></li></ul>
-<p>You can use the TransformerImpl getProperty(String) and
setProperty(String). The getProperty method returns a boolean. For the String
argument, use the static String variable or literal URI String as indicated
below.</p><anchor name="source-location"/>
-<s3 title='"http://apache.org/xalan/properties/source-location"'>
-<p>Provide a <jump
href="apidocs/javax/xml/transform/SourceLocator.html">SourceLocator</jump> that
can be used from within a stylesheet, programatically, or in the command-line
utility to obtain the location in a source document (system ID, public ID, line
number, and column number) of individual nodes. By default, this property is
off.</p>
-<note>The <link idref="commandline">command-line utility</link> -L flag,
<link idref="usagepatterns" anchor="debugging">PrintTraceListener</link>, and
<link idref="extensionslib" anchor="nodeinfo">NodeInfo</link> extension set
this property to Boolean.TRUE.</note>
-<p>To set the SourceLocation property, you can use the
XalanProperties.SOURCE_LOCATION static variable (equivalent to the URI String
above) as follows:</p>
+</s3><anchor name="source-location"/>
+<s3 title='"http://apache.org/xalan/features/source-location"'>
+<p>Provide a <jump
href="apidocs/javax/xml/transform/SourceLocator.html">SourceLocator</jump> that
can be used from within a stylesheet,
+programatically, or in the command-line utility to obtain the location in a
source document (system ID, public ID, line number, and column number)
+of individual nodes.</p>
+<p>By default, this attribute is off. The <link
idref="commandline">command-line utility</link> -L flag sets this attribute to
Boolean.TRUE.
+You must set this attribute to Boolean.TRUE if you want to use the <link
idref="extensionslib" anchor="nodeinfo">NodeInfo</link> extension
+functions.</p>
+<p>To set the source-location attribute, you can use the
TransformerFactoryImpl.FEATURE_SOURCE_LOCATION static variable (equivalent to
the URI String above) as follows:</p>
<source>import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Transformer;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.transformer.XalanProperties;
..
TransformerFactory tFact = TransformerFactory.newInstance();
-Transformer transformer =
- tFact.newTransformer(new StreamSource("foo.xsl"));
-if (transformer instanceof TransformerImpl) {
- TransformerFactoryImpl transImpl =
- (TransformerFactoryImpl)transformer;
- transImpl.setProperty(XalanProperties.SOURCE_LOCATION,
- Boolean.TRUE);
- ..
+if (tFact instanceof TransformerFactoryImpl) {
+ tFact.setAttribute(TransformerFactoryImpl.FEATURE_SOURCE_LOCATION,
+ Boolean.TRUE);
}</source>
</s3>
</s2>
1.49 +1 -1 xml-xalan/java/xdocs/sources/xalan/usagepatterns.xml
Index: usagepatterns.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/usagepatterns.xml,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- usagepatterns.xml 30 Jan 2002 14:23:52 -0000 1.48
+++ usagepatterns.xml 30 Jan 2002 22:23:12 -0000 1.49
@@ -76,7 +76,7 @@
<li><link anchor="multithreading">Multithreading</link></li>
<li><link anchor="debugging">Debugger interface</link></li>
</ul>
-<p>See also: <link idref="features">Tranformer Features</link>.</p>
+<p>See also: <link idref="features">Transform Features</link>.</p>
<anchor name="basic"/>
<s2 title="Basic steps">
<ol>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]