You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by dl...@locus.apache.org on 2000/10/05 22:17:27 UTC
cvs commit: xml-xalan/java/samples/extensions 1-redir.xsl MyCounter.java
dleslie 00/10/05 13:17:15
Modified: java/samples/extensions 1-redir.xsl MyCounter.java
Log:
1.1-redir.xsl -- Editorial fix
2. MyCounter.java -- Changed Hashtable to static.Extnsion now works!
Revision Changes Path
1.3 +3 -2 xml-xalan/java/samples/extensions/1-redir.xsl
Index: 1-redir.xsl
===================================================================
RCS file: /home/cvs/xml-xalan/java/samples/extensions/1-redir.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 1-redir.xsl 2000/10/04 17:00:32 1.2
+++ 1-redir.xsl 2000/10/05 20:17:13 1.3
@@ -3,11 +3,11 @@
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:redirect="org.apache.xalan.lib.Redirect"
extension-element-prefixes="redirect">
-
+
<lxslt:component prefix="redirect" elements="write open close" functions="">
<lxslt:script lang="javaclass" src="org.apache.xalan.lib.Redirect"/>
</lxslt:component>
-
+
<xsl:template match="/">
<standard-out>
Standard output:
@@ -18,6 +18,7 @@
<!-- not redirected -->
<xsl:template match="doc/main">
<main>
+ -- look in <xsl:value-of select="/doc/foo/@file"/> for the redirected output --
<xsl:apply-templates/>
</main>
</xsl:template>
1.4 +4 -4 xml-xalan/java/samples/extensions/MyCounter.java
Index: MyCounter.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/samples/extensions/MyCounter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MyCounter.java 2000/10/04 17:01:15 1.3
+++ MyCounter.java 2000/10/05 20:17:13 1.4
@@ -1,7 +1,7 @@
import java.util.Hashtable;
public class MyCounter {
- Hashtable counters = new Hashtable ();
+ static Hashtable counters = new Hashtable ();
public void init(org.apache.xalan.extensions.XSLProcessorContext context,
@@ -23,9 +23,9 @@
}
public int read(String name)
- {
- Integer cval = (Integer) counters.get (name);
- return (cval == null) ? 0 : cval.intValue ();
+ {
+ Integer cval = (Integer)counters.get(name);
+ return (cval == null) ? 0 : cval.intValue();
}
public void incr(org.apache.xalan.extensions.XSLProcessorContext context,