xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dles...@locus.apache.org
Subject cvs commit: xml-site/targets/xalan extensions.html
Date Tue, 01 Feb 2000 21:57:41 GMT
dleslie     00/02/01 13:57:40

  Modified:    targets/xalan extensions.html
  Log:
  Still rough, but a major revision and ready for tech review.
  
  Revision  Changes    Path
  1.2       +494 -402  xml-site/targets/xalan/extensions.html
  
  Index: extensions.html
  ===================================================================
  RCS file: /home/cvs/xml-site/targets/xalan/extensions.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- extensions.html	2000/01/18 21:59:21	1.1
  +++ extensions.html	2000/02/01 21:57:40	1.2
  @@ -1,163 +1,215 @@
  -<HTML><HEAD><SCRIPT language="JavaScript" src="resources/script.js" type="text/javascript"></SCRIPT><TITLE>Xalan-Java Extensions</TITLE></HEAD><BODY alink="#ff0000" bgcolor="#ffffff" leftmargin="4" link="#0000ff" marginheight="4" marginwidth="4" text="#000000" topmargin="4" vlink="#0000aa"><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" height="60" rowspan="3" valign="top" width="135"><IMG border="0" height="60" hspace="0" src="resources/logo.gif" vspace="0" width="135"></TD><TD align="left" colspan="4" height="5" valign="top" width="456"><IMG border="0" height="5" hspace="0" src="resources/line.gif" vspace="0" width="456"></TD><TD align="left" height="60" rowspan="3" valign="top" width="29"><IMG border="0" height="60" hspace="0" src="resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD align="left" bgcolor="#0086b2" colspan="4" height="35" valign="top" width="456"><IMG alt="" border="0" height="35" hspace="0" src="graphics/extensions-header.jpg" vspace="0" width
="456"></TD></TR><TR><TD align="left" height="20" valign="top" width="168"><IMG border="0" height="20" hspace="0" src="resources/bottom.gif" vspace="0" width="168"></TD><TD align="left" height="20" valign="top" width="96"><A href="http://xml.apache.org/" onMouseOut="rolloverOff('xml');" onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xml.apache.org/" border="0" height="20" hspace="0" name="xml" onLoad="rolloverLoad('xml','resources/button-xml-hi.gif','resources/button-xml-lo.gif');" src="resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.apache.org/" onMouseOut="rolloverOff('asf');" onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/" border="0" height="20" hspace="0" name="asf" onLoad="rolloverLoad('asf','resources/button-asf-hi.gif','resources/button-asf-lo.gif');" src="resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A 
href="http://www.w3.org/" onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');" target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0" name="w3c" onLoad="rolloverLoad('w3c','resources/button-w3c-hi.gif','resources/button-w3c-lo.gif');" src="resources/button-w3c-lo.gif" vspace="0" width="96"></A></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" valign="top" width="120"><IMG border="0" height="14" hspace="0" src="resources/join.gif" vspace="0" width="120"><BR>
  +<HTML><HEAD><SCRIPT language="JavaScript" src="resources/script.js" type="text/javascript"></SCRIPT><TITLE>Xalan Extensions</TITLE></HEAD><BODY alink="#ff0000" bgcolor="#ffffff" leftmargin="4" link="#0000ff" marginheight="4" marginwidth="4" text="#000000" topmargin="4" vlink="#0000aa"><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" height="60" rowspan="3" valign="top" width="135"><IMG border="0" height="60" hspace="0" src="resources/logo.gif" vspace="0" width="135"></TD><TD align="left" colspan="4" height="5" valign="top" width="456"><IMG border="0" height="5" hspace="0" src="resources/line.gif" vspace="0" width="456"></TD><TD align="left" height="60" rowspan="3" valign="top" width="29"><IMG border="0" height="60" hspace="0" src="resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD align="left" bgcolor="#0086b2" colspan="4" height="35" valign="top" width="456"><IMG alt="" border="0" height="35" hspace="0" src="graphics/extensions-header.jpg" vspace="0" width="456
"></TD></TR><TR><TD align="left" height="20" valign="top" width="168"><IMG border="0" height="20" hspace="0" src="resources/bottom.gif" vspace="0" width="168"></TD><TD align="left" height="20" valign="top" width="96"><A href="http://xml.apache.org/" onMouseOut="rolloverOff('xml');" onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xml.apache.org/" border="0" height="20" hspace="0" name="xml" onLoad="rolloverLoad('xml','resources/button-xml-hi.gif','resources/button-xml-lo.gif');" src="resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.apache.org/" onMouseOut="rolloverOff('asf');" onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/" border="0" height="20" hspace="0" name="asf" onLoad="rolloverLoad('asf','resources/button-asf-hi.gif','resources/button-asf-lo.gif');" src="resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href=
"http://www.w3.org/" onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');" target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0" name="w3c" onLoad="rolloverLoad('w3c','resources/button-w3c-hi.gif','resources/button-w3c-lo.gif');" src="resources/button-w3c-lo.gif" vspace="0" width="96"></A></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" valign="top" width="120"><IMG border="0" height="14" hspace="0" src="resources/join.gif" vspace="0" width="120"><BR>
   
     
  -  
  -  <A href="../index.html" onMouseOut="rolloverOff('side-ext-4');" onMouseOver="rolloverOn('side-ext-4');"><IMG alt="Home" border="0" height="12" hspace="0" name="side-ext-4" onLoad="rolloverLoad('side-ext-4','graphics/ext-4-label-2.jpg','graphics/ext-4-label-3.jpg');" src="graphics/ext-4-label-3.jpg" vspace="0" width="120"></A><BR>
  -  
  -  <IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
  -  
  -  <A href="overview.html" onMouseOut="rolloverOff('side-overview');" onMouseOver="rolloverOn('side-overview');"><IMG alt="Overview" border="0" height="12" hspace="0" name="side-overview" onLoad="rolloverLoad('side-overview','graphics/overview-label-2.jpg','graphics/overview-label-3.jpg');" src="graphics/overview-label-3.jpg" vspace="0" width="120"></A><BR>
  -            
  -  <IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
  -
  -  <A href="install.html" onMouseOut="rolloverOff('side-install');" onMouseOver="rolloverOn('side-install');"><IMG alt="Installation" border="0" height="12" hspace="0" name="side-install" onLoad="rolloverLoad('side-install','graphics/install-label-2.jpg','graphics/install-label-3.jpg');" src="graphics/install-label-3.jpg" vspace="0" width="120"></A><BR>
  -
  -  <A href="readme.html" onMouseOut="rolloverOff('side-readme');" onMouseOver="rolloverOn('side-readme');"><IMG alt="Release Notes" border="0" height="12" hspace="0" name="side-readme" onLoad="rolloverLoad('side-readme','graphics/readme-label-2.jpg','graphics/readme-label-3.jpg');" src="graphics/readme-label-3.jpg" vspace="0" width="120"></A><BR>
  -            
  -  <IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>           
  -            
  -  <A href="commandline.html" onMouseOut="rolloverOff('side-commandline');" onMouseOver="rolloverOn('side-commandline');"><IMG alt="Command Line" border="0" height="12" hspace="0" name="side-commandline" onLoad="rolloverLoad('side-commandline','graphics/commandline-label-2.jpg','graphics/commandline-label-3.jpg');" src="graphics/commandline-label-3.jpg" vspace="0" width="120"></A><BR>
  -
  -  <A href="api.html" onMouseOut="rolloverOff('side-api');" onMouseOver="rolloverOn('side-api');"><IMG alt="Xalan API" border="0" height="12" hspace="0" name="side-api" onLoad="rolloverLoad('side-api','graphics/api-label-2.jpg','graphics/api-label-3.jpg');" src="graphics/api-label-3.jpg" vspace="0" width="120"></A><BR>
  -            
  -  <IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
  -
  -  <A href="dtm.html" onMouseOut="rolloverOff('side-dtm');" onMouseOver="rolloverOn('side-dtm');"><IMG alt="Xalan DTM" border="0" height="12" hspace="0" name="side-dtm" onLoad="rolloverLoad('side-dtm','graphics/dtm-label-2.jpg','graphics/dtm-label-3.jpg');" src="graphics/dtm-label-3.jpg" vspace="0" width="120"></A><BR>
  -            
  -  <IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
  -  
  +   
     <IMG alt="Extensions" border="0" height="12" hspace="0" src="graphics/extensions-label-1.jpg" vspace="0" width="120"><BR>
               
  -  <IMG border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR>
  -
  -  <A href="xslt4c.html" onMouseOut="rolloverOff('side-xslt4c');" onMouseOver="rolloverOn('side-xslt4c');"><IMG alt="Xalan C++" border="0" height="12" hspace="0" name="side-xslt4c" onLoad="rolloverLoad('side-xslt4c','graphics/xslt4c-label-2.jpg','graphics/xslt4c-label-3.jpg');" src="graphics/xslt4c-label-3.jpg" vspace="0" width="120"></A><BR>             
   <IMG border="0" height="14" hspace="0" src="resources/close.gif" vspace="0" width="120"><BR></TD><TD align="left" valign="top" width="500"><TABLE border="0" cellpadding="3" cellspacing="0"><TR><TD>
  -   
  -	 <TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Introduction</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vsp
ace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  -<P>For those situations where you would like to augment the functionality of XSLT with calls to a procedural language, Xalan-Java supports the creation and use of extension elements and extension functions.</P>
  -<P>You can set up Xalan-Java components to define extension elements and extension functions that call Java classes and Javascript scripts. In your XSL stylesheets, you can then use extension components to set script properties, for example, and extension functions to return values. Xalan-Java also provides a predefined &quot;java&quot; extension namespace that you can use to interact directly with Java objects.</P>
  -<P>Furthermore, Xalan-Java ships with a propriatary extension that you can use to redirect the output of an XSL transformation to multiple files. This extension is implemented in the org.apache.xalan.xslt.extensions.Redirect class. Suggestions for extensions to add in future releases are more than welcome.</P>
  -</FONT></TD></TR></TABLE><BR>
  +<UL>
  +<LI><A href="#intro">Introduction</A></LI>
  +<LI><A href="#supported-lang">Supported languages</A></LI>
  +<LI><A href="#basic-pattern">The basic pattern</A></LI>
  +<LI><A href="#setup-runtime">Setting up the runtime environment</A></LI>
  +<LI><A href="#basic-syntax">Syntax</A></LI>
  +<LI><A href="#ext-elements">Using an extension element</A></LI>
  +<LI><A href="#ext-functions">Using extension functions</A></LI>
  +<LI><A href="#java-namespace">Alternative: using the predefined java extension namespace</A></LI>
  +<LI>Examples: <A href="#ex-basic">basic JavaScript example</A>, <A href="#ex-redirect">the Redirect extension</A>, <A href="#ex-java-namespace">using the java namespace</A>, <A href="#ex-java">using a Java Hashtable</A>, <A href="#ex-javascript">using a JavaScript array</A></LI>
  +</UL><A name="intro"><!--anchor--></A>
  +  <TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Introduction</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vsp
ace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  +  <P>For those situations where you would like to augment the functionality of XSLT with calls to a procedural language, Xalan supports the creation and use of extension elements and extension functions. An extension (a collection of elements and functions) inhabits a namespace, either a namespace you declare and designate as an extensions namespace, or the predefined java namespace that Xalan provides.</P>
  +
  +<P><B>Extension elements</B>  Unlike a literal result element, which the stylesheet simply transfers to the result tree, an extension element performs an action. For example, you can use the Redirect extension elements shipped with Xalan to redirect portions of your transformation output to one or more files. Extension elements may contain attributes, text nodes, other elements, basically any form of the content you can place in an XML element. Extension elements may perform quite sophisticated actions, given that the extension routine has direct access to the XSL processor context object and to the element. In many cases the implementation returns void or null; if it does return a value, that value is placed in the transformation result.</P>
  +
  +<P><B>Extension functions</B>You can think of extension functions as extensions to the core library of functions that XPath provides. An extension function passes arguments to the extension and returns a value. You can use extension functions to return values that XSLT can interact with directly (node-set, result tree fragment, string, boolean, and number) as well as values (of any type) that you pass in turn to other extension functions.</P>
  +</FONT></TD></TR></TABLE><BR><A name="supported-lang"><!--anchor--></A>
   <TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Supported languages</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif
" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  -<P>Xalan-Java uses he Bean Scripting Framework (BSF), an architecture for incorporating scripting into Java
  -  applications and applets. Using BSF allows an application to take advantage of scripting while being
  -  independent of any specific scripting language. </P>
  -  <P>To use BSF, you must put two JAR files on the classpath: bsf.jar and bsfengine.jar. For JavaScript support, BSF has been tested with Mozilla Rhino 1.4 R3 js.jar, available from http://www.mozilla.org/rhino. We do not ship js.jar.</P>
  +<P>Xalan uses the Bean Scripting Framework (BSF), an architecture for incorporating scripting into Java applications and applets. BSF allows an application to take advantage of scripting while being independent of any specific scripting language. To date, we have tested extensions implemented in Java and JavaScript. Other languages with BSF support appear in the table below.</P>
  +<P>BSF requires two JAR files on the classpath: bsf.jar and bsfengines.jar. These two JAR files are shipped with Xalan, and that is all that is required for Java extensions. The additional JAR files or DLLs required to support extensions in other languages are listed in the table below. These files are available from the sources indicated and are not shipped with Xalan.</P>
   <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
     <TR>
       <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><B>Language</B>&nbsp;
         </FONT></TD>
       <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><B>Version</B>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><B>Dependencies</B>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><B>Requirements</B>&nbsp;
         </FONT></TD>
     </TR>
     <TR>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>Mozilla Rhino</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Mozilla Rhino<BR><BR>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>1.4 R3</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">1.4 R3<BR><BR>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>js.jar available from 
  -				    http://www.mozilla.org/rhino</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">js.jar available from 
  +				    http://www.mozilla.org/rhino<BR><BR>&nbsp;
         </FONT></TD>
     </TR>
     <TR>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>NetRexx</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">NetRexx<BR><BR>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>1.148 up </P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">1.148 up <BR><BR>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>NetRexxC.zip available from http://www2.hursley.ibm.com/netrexx</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">NetRexxC.zip available from http://www2.hursley.ibm.com/netrexx<BR><BR>&nbsp;
         </FONT></TD>
     </TR>
       <TR>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>BML</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">BML<BR><BR>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>2.4</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">2.4<BR><BR>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>bmlall.jar available from http://www.alphaWorks.ibm.com/formula/bml</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">bmlall.jar available from http://www.alphaWorks.ibm.com/formula/bml<BR><BR>&nbsp;
         </FONT></TD>
     </TR>
       <TR>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>JPython</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">JPython<BR><BR>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>1.1-beta3</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">1.1-beta3<BR><BR>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>python.jar available from http://www.jpython.org/</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">python.jar available from http://www.jpython.org/<BR><BR>&nbsp;
         </FONT></TD>
     </TR>
       <TR>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>Jacl</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Jacl<BR><BR>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>1.1.1</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">1.1.1<BR><BR>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P> jacl.jar and tcljava.jar from http://www.scriptics.com/java</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> jacl.jar and tcljava.jar from http://www.scriptics.com/java<BR><BR>&nbsp;
         </FONT></TD>
     </TR>
       <TR>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>Win32 ActiveScript langs
  -	JScript, VBScript</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Win32 ActiveScript langs
  +	JScript, VBScript<BR><BR>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P></P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR><BR>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>MSVCP60.DLL from Microsoft, appropriate language DLLs from Microsoft 
  -    http://msdn.microsoft.com/scripting</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">MSVCP60.DLL from Microsoft, appropriate language DLLs from Microsoft 
  +    http://msdn.microsoft.com/scripting<BR><BR>&nbsp;
         </FONT></TD>
     </TR>
       <TR>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>PerlScript</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">PerlScript<BR><BR>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P></P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR><BR>&nbsp;
         </FONT></TD>
  -    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><P>ActivePerl from http://www.activestate.com/</P>&nbsp;
  +    <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">ActivePerl from http://www.activestate.com/<BR><BR>&nbsp;
         </FONT></TD>
     </TR>  
   </TABLE>
  -</FONT></TD></TR></TABLE><BR>
  -<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Xalan-Java components</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.g
if" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  -
  -<P>To set up extensions, do the following in an XSL stylesheet:</P>
  +</FONT></TD></TR></TABLE><BR><A name="basic-pattern"><!--anchor--></A>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>The basic pattern</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" 
vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  +<P>The stylesheet below uses an extension element and an extension function to transform each &lt;deadline numdays=&quot;<I>n</I>&quot;/&gt; element in the XML source into a statement indicating the date by which a customer should receive a response to an enquiry.</P>
  +
  +<P>The extension element contains a multiplier attribute, which is used to set a variable in the extension. The extension function computes the deadline, that is the current date plus numdays * multiplier. So for &lt;deadline numdays=&quot;3&quot;/&gt; (in the XML source) and &lt;timelapse multiplier=&quot;2&quot;/&gt; (in the stylesheet), the extension computes a deadline 6 days from now, and the stylesheet template  transform the deadline element into a string along the lines of <CODE><FONT face="courier, monospaced">&lt;p&gt;We have received your enquiry and will respond by April 29, 2000 12:07:16 PM EST.&lt;/p&gt;</FONT></CODE></P>
  +<TABLE border="0" cellpadding="0" cellspacing="3" width="100%"><TR><TD valign="top" width="20"><IMG alt="Note" border="0" height="24" hspace="0" src="resources/note.gif" vspace="0" width="20"></TD><TD valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><I>In case your noticed, the extension function could include both numdays and multiplier as arguments, thus bypassing the need for the extension element. The purpose here is to illustrate the usage pattern for both extension elements and extension functions.</I></FONT></TD></TR></TABLE>
  +<P>As you review this stylesheet, please note the following:</P>
   <OL>
  -  <LI>Declare the Xalan-Java xslt namespace</LI>
  -  <LI>Declare a namespace for at least one extension prefix</LI>
  -  <LI>Use the extension-element-prefixes attribute on the xsl:stylesheet element, a literal result
  -  element, or another extension element to declare the extension namespace as an extension</LI>
  -</OL>
  -<P>Then you can utilize the extension elements and associated extension functions in your stylesheet
  -templates.</P>
  -<P>To implement the extension, define a Xalan-Java component in the xslt namespace. A Xalan-Java component may be embedded within the stylesheet or maintained separately. The component contains the code that is called when the extension elements and functions are used.</P>
  -<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Xalan-Java Component Syntax</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" 
vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  -<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  -                   xmlns:lxslt=&quot;http://xml.apache.org.xslt&quot;
  -                   xmlns:extn1=&quot;URI of extension namespace1&quot;
  -                   extension-element-prefixes=&quot;extn1 extn2&quot;&gt;
  -
  -  &lt;xsl:template match=&quot;...&quot;&gt;
  -    ...
  -    &lt;extn1:element1 att1=&quot;value1&quot; att2=&quot;value2&quot; ...&gt;
  -      &lt;whatever-the-contents/&gt;
  -      &lt;including-xsl-elements/&gt;
  -    &lt;/extn1&gt;
  -    ...
  -    &lt;xsl:value-of select=&quot;extn1:function1(arg1,arg2,...,argn)&quot;/&gt;
  -    ...
  -  &lt;/xsl:template&gt;
  -
  -  &lt;lxslt:component prefix=&quot;extn1&quot; elements=&quot;element1&quot; functions=&quot;function1&quot;&gt; 
  +	  <LI>The declaration of the Xalan lxslt namespace, which provides support for the component and
  +     component/script elements:<BR><BR>
  +    <CODE><FONT face="courier, monospaced">xmlns:lxslt=&quot;http://xml.apache.org/xslt&quot;</FONT></CODE><BR><BR></LI>
  +    <LI>The declaration of a namespace for this extension:<BR><BR>
  +    <CODE><FONT face="courier, monospaced">xmlns:my-ext=&quot;ext1&quot;</FONT></CODE><BR><BR></LI>
  +  	<LI>The designation of this namespace prefix as an extension prefix:<BR><BR>
  +     <CODE><FONT face="courier, monospaced">extension-element-prefixes=&quot;my-ext&quot;</FONT></CODE><BR><BR></LI>
  +	  <LI>The lxslt:component with attributes designating the namespace prefix and the elements and
  +     functions this extension provides.<BR><BR></LI>
  +  	<LI>The lxslt:script subelement with a JavaScript implementation of the extension. For Java
  +     extensions, the lxslt:script element has a src attribute that you set to identify the Java class.</LI>
  +  </OL><A name="ex-basic"><!--anchor--></A>   
  +<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>&lt;?xml version=&quot;1.0&quot;?&gt;
  +&lt;!--Namespaces are global if you set them in the stylesheet element--&gt;
  +&lt;xsl:stylesheet 
  +    xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; 
  +    version=&quot;1.0&quot;   
  +    xmlns:lxslt=&quot;http://xml.apache.org/xslt&quot;
  +    xmlns:my-ext=&quot;ext1&quot;
  +    extension-element-prefixes=&quot;my-ext&quot;&gt;
  +    
  +  &lt;!--The component and its script are in the lxslt namespace and define the 
  +    implementation of the extension.--&gt;
  +  &lt;lxslt:component prefix=&quot;my-ext&quot; elements=&quot;timelapse&quot; functions=&quot;getdate&quot;&gt;
       &lt;lxslt:script lang=&quot;javascript&quot;&gt;
  -      function element1 (xslProcContext, exensionElement) {
  -        code to do element1, including possibly evaluating the
  -        contents of the element by calling back to the processor
  +      var multiplier=1;
  +      // The methods or functions that implement extension elements always take two arguments. 
  +      // The first argument is the XSL Processor context; the second argument is the element node.
  +      function timelapse(xslProcessorContext, elem)
  +      {
  +        multiplier=parseInt(elem.getAttribute(&quot;multiplier&quot;));
  +        // The element return value is placed in the result tree.
  +        // If you do not want a return value, return null.
  +        return null;
         }
  -
  -      function function1 (arg1, arg2, ..., argn) {
  -        code to do function1
  +      function getdate(numdays)
  +      {
  +        var d = new Date();
  +        var totalDays = parseInt(numdays) * multiplier;
  +        d.setDate(d.getDate() + totalDays);
  +        return d.toLocaleString();
         }
  -    &lt;/lxslt:script&gt; 
  +    &lt;/lxslt:script&gt;
     &lt;/lxslt:component&gt;
  -&lt;/xsl:stylesheet&gt;</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  -</FONT></TD></TR></TABLE><BR>
  +      
  +  &lt;xsl:template match=&quot;deadline&quot;&gt;
  +    &lt;p&gt;&lt;my-ext:timelapse multiplier=&quot;2&quot;/&gt;We have logged your enquiry and will 
  +      respond by &lt;xsl:value-of select=&quot;my-ext:getdate(string(@numdays))&quot;/&gt;.&lt;/p&gt;
  +  &lt;/xsl:template&gt;
   
  -<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>DTD for Xalan-Java Components</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif
" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +&lt;/xsl:stylesheet&gt;
  +</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  +</FONT></TD></TR></TABLE><BR><A name="setup-runtime"><!--anchor--></A>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Setting up the runtime environment</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="res
ources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  +<P>To run the preceding example, bsf.jar, bsfengines.jar, and js.jar must be on the class path. Remember that bsf.jar and bsfengines.jar must be on the class path to run any extension. For extensions implemented in a scripting language, see the requirements in <A href="#supported-lang">Supported languages</A>.</P>
  +</FONT></TD></TR></TABLE><BR><A name="basic-syntax"><!--anchor--></A>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Syntax</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" 
width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  +<P>You can always use the pattern illustrated above to set up and use extension elements and extension functions. For extension functions implemented in Java, you can also use the java namespace, described in <A href="#java-namespace">Alternative: using the predefined java extension namespace</A>. Unless you are using the predefined java extension namespace, do the following:</P>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>1. Declare the lxslt namespace</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gi
f" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P><CODE><FONT face="courier, monospaced">xmlns:lxslt=&quot;http://xml.apache.org/xslt&quot;</FONT></CODE></P>
  +<P>The lxslt namespace provides support for the lxslt:component element and lxslt:script subelement.</P>
  +<TABLE border="0" cellpadding="0" cellspacing="3" width="100%"><TR><TD valign="top" width="20"><IMG alt="Note" border="0" height="24" hspace="0" src="resources/note.gif" vspace="0" width="20"></TD><TD valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><I>You may also use the LotusXSL alias for this namespace: &quot;http://xsl.lotus.com/&quot;.</I></FONT></TD></TR></TABLE>
  +</FONT></TD></TR></TABLE><BR>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>2. Declare a unique namespace for each extension prefix</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="
0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P><BR><CODE><FONT face="courier, monospaced">xmlns:<I>prefix</I>:<I>URI</I></FONT></CODE></P>
  +<P>The <I>prefix</I> identifies the namespace, and <I>URI</I> is one of the following:</P>
  +<UL>
  +  <LI>An arbitrary (but unique) string.<BR><BR></LI>
  +  <LI><CODE><FONT face="courier, monospaced">[class:]<I>FQCN</I></FONT></CODE><BR>
  +  where <I>FQCN</I> is a Java fully qualified class name. If the extension only involves static class method calls (no instance constructors or instance method calls) precede the class name with <CODE><FONT face="courier, monospaced">class:</FONT></CODE>.<BR><BR></LI>
  +  <LI>The file name or URL for another document that contains the xslt:component element.</LI>
  +</UL>
  +<P>If the stylesheet contains an xslt:component element with a prefix attribute set to the extension prefix, the only function of the URI is to provide a unique namespace. If the stylesheet does not contain an xslt:component, the URI must identify a Java class or a document containing the xslt:component.</P>
  +</FONT></TD></TR></TABLE><BR>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>3. Designate the extension prefixes</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/vo
id.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P>In the stylesheet element:</P> 
  +<P><CODE><FONT face="courier, monospaced">extension-element-prefixes=&quot;<I>prefix-1 prefix-2 ...</I>&quot;</FONT></CODE></P>
  +<P>In a literal result element or extension element include the xsl prefix:</P>
  +<P><CODE><FONT face="courier, monospaced">xsl:extension-element-prefixes=&quot;<I>prefix1 prefix 2 ...</I>&quot;</FONT></CODE></P>
  +<P>Keep in mind that where you declare namespaces and designate extension prefixes determines the scope of those namespaces.To make your extensions available throughout the stylesheet, include these settings and attribute in the stylesheet element.</P>
  +<P>By default, namespace declarations are included in the transformation output. To exclude namespaces from the output, use</P>
  +<P><CODE><FONT face="courier, monospaced">exclude-result-prefixes=&quot;<I>prefix-1 prefix-2 ...</I>&quot;</FONT></CODE></P>
  +<P>in the stylesheet element or</P>
  +<P><CODE><FONT face="courier, monospaced">xsl:exclude-result-prefixes=&quot;<I>prefix-1 prefix-2 ...</I>&quot;</FONT></CODE></P> 
  +<P>in a literal result element or extension element.</P>
  +</FONT></TD></TR></TABLE><BR>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>4. Set up an lxslt:component</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif"
 vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P>In the scope of the xslt namespace declaration:</P>
  +<P><CODE><FONT face="courier, monospaced">&lt;xslt:component prefix=&quot;<I>prefix</I>&quot; </FONT></CODE><BR>
  +   <CODE><FONT face="courier, monospaced">&nbsp;&nbsp;&nbsp;&nbsp;functions=&quot;<I>func-1 func-2 ...func-n</I>&quot;</FONT></CODE><BR> 
  +   <CODE><FONT face="courier, monospaced">&nbsp;&nbsp;&nbsp;&nbsp;elements=&quot;<I>elem-1 elem-2 ...elem-n</I>&quot;&gt;</FONT></CODE><BR>
  +   <CODE><FONT face="courier, monospaced">&nbsp;&nbsp;&lt;!--See lxslt:script below--&gt;</FONT></CODE><BR>
  +   <CODE><FONT face="courier, monospaced">&lt;/xslt:component&gt;</FONT></CODE></P>
  +<P>where <I>func-1 func-2 ... func-n</I> and <I>elem-1 elem-2 elem-n</I> designate the functions and elements the extension provides and the stylesheet uses. You can use the function-available and element-available functions to determine at run time whether a function or element designated in the xslt:component is actually available.</P>
  +<TABLE border="0" cellpadding="0" cellspacing="3" width="100%"><TR><TD valign="top" width="20"><IMG alt="Note" border="0" height="24" hspace="0" src="resources/note.gif" vspace="0" width="20"></TD><TD valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><I>If your extension namespace is a fully qualified class name, you do not need to include the xslt:component. If you do not include it, you cannot use the function-available and element-available functions to determine whether a given element or function is actually available at runtime.</I></FONT></TD></TR></TABLE>
  +</FONT></TD></TR></TABLE><BR>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>5. Set up the lxslt:script element</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/voi
d.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P>In each xslt:component, you must include an lxslt:script element. If the extension is implemented in Java:</P>
  +<P><CODE><FONT face="courier, monospaced">&lt;lxslt:script lang=&quot;javaclass&quot; src=&quot;<I>[class:]FQCN</I>&quot;/&gt;</FONT></CODE></P>
  +<P>where <I>FQCN</I> is the fully qualified class name. If the extension only involves static class method calls (no instance constructors or instance method calls) precede the class name with <CODE><FONT face="courier, monospaced">class:</FONT></CODE>.</P>
  +<P>If the extension is implemented in JavaScript:</P>
  +<P><CODE><FONT face="courier, monospaced">&lt;lxslt:script lang=&quot;javascript&quot; &gt;</FONT></CODE><BR>
  +<CODE><FONT face="courier, monospaced">&nbsp;&nbsp;&lt;!--The implementation script--&gt;</FONT></CODE><BR>
  +<CODE><FONT face="courier, monospaced">&lt;/lxslt:script&gt;</FONT></CODE></P>
  +<P>For other scripting languages supported by BSF, use the same approach as for JavaScript. Xalan 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>
  +</FONT></TD></TR></TABLE><BR>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Implicit DTD for lxslt:component</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.
gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
   <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>&lt;!ELEMENT lxslt:component (lxslt:script)&gt;
   &lt;!ATTLIST lxslt:component
     prefix CDATA #IMPLIED
  @@ -170,298 +222,321 @@
     lang CDATA #REQUIRED
     src CDATA #IMPLIED&gt;</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
   </FONT></TD></TR></TABLE><BR>
  +</FONT></TD></TR></TABLE><BR><A name="ext-elements"><!--anchor--></A>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Using an extension element</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/v
oid.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  +<P>Extension elements pass the extension two objects:</P>
  +<UL>
  +<LI><A href="apidocs/org/apache/xalan/xslt/XSLProcessorContext.html">org.apache.xalan.xslt.XSLProcessorContext</A>, which provides access to the XSL processor, the XML source tree, the stylesheet tree, the current context node, and the current mode (if any).<BR><BR></LI>
  +<LI>org.w3c.dom.Element, which provides the API for interacting with the extension element.</LI>
  +</UL>
  +<P>You can use the Element getAttribute(String name) method, for example, to read element attributes.</P>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Implementing an extension element</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void
.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P>For each extension element in a namespace, the implementation must be a Java method with the following signature, or the scripting language equivalent:</P>
  +<P><CODE><FONT face="courier, monospaced"><I>Type element</I>(org.apache.xalan.xslt.XSLProcessorContext, </FONT></CODE><BR>
  +<CODE><FONT face="courier, monospaced">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;org.w3c.dom.Element extensionElement)</FONT></CODE></P>
  +<P>where <I>Type</I> designates the return type and <I>element</I> is the local part of the extension element name (the element name without the namespace prefix).</P>
  +<P>If the extension element is implemented in a loosely typed scripting language, such as JavaScript, the arguments and return value are untyped.</P>
  +<P><B>Caution:</B> The value returned by an extension element is placed in the transformaiton result. If you are not interested in a return value, use a public void Java method or return null from a scripting language function.</P>
  +</FONT></TD></TR></TABLE><BR>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>The Redirect extension</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspac
e="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P>The Redirect extension (<A href="apidocsorg/apache/xalan/xslt/extensions/Redirect.html">org.apache.xalan.xslt.extensions.Redirect</A>) is shipped with Xalan (more extensions are on the way!).</P>
  +<P>A standard XSL transformation involves three parameters: the XML source tree, an XSL stylesheet, and the transformation result tree. Whether, the result tree is output to a file, a character stream, a byte stream, a DOM, or a SAX document handler, the initial transformation sends the entire result to a single target, represented by the <A href="apidocs/org/apache/xalan/xslt/XSLTResultTarget.html" target="_top">XSLTResultTarget class</A>.</P> 
  +<P>The Redirect extension supplies three extension elements that you can use to redirect portions of your transformation output to multiple files: &lt;open&gt;, &lt;write&gt;, and &lt;close&gt;. If you use the &lt;write&gt; element alone, the extension opens a file, writes to it, and closes the file immediately. If you want explicit control over the opening and closing of files, use &lt;write&gt; in conjunction with the &lt;open&gt; and &lt;close&gt; elements.</P>
  +<P>Each of these elements includes a file attribute and/or a select attribute to designate the output file. The file attribute takes a string, so you can use it to directly specify the output file name; The select attribute takes an XPath expression, so you can use it to dynamically generate the output file name. If you include both attributes, the Redirect extension first evaluates the select attribute, and falls back to the file attribute if the select attribute expression does not return a valid file name.</P>
  +</FONT></TD></TR></TABLE><BR><A name="ex-redirect"><!--anchor--></A> 
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Example with the Redirect extension</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/vo
id.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P>Suppose you are outputting the bulk of your result tree to one file, but you want to output the transformation of all &lt;foo&gt; elements and their children to another file. The following example illustrates the basic structure of the XML source:</P>
  +<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>&lt;?xml version=&quot;1.0&quot;?&gt; 
  +&lt;doc&gt;
  +  &lt;foo file=&quot;foo.out&quot;&gt;
  +    Testing Redirect extension:
  +      &lt;bar&gt;A foo subelement text node&lt;/bar&gt;
  +  &lt;/foo&gt;
  +  &lt;main&gt;
  +    Everything else
  +  &lt;/main&gt;  
  +&lt;/doc&gt;</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  +<P>This stylesheet redirects part of the output to a secondary file:</P>
  +<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>
  +&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  +    version=&quot;1.0&quot;
  +    xmlns:lxslt=&quot;http://xml.apache.org/xslt&quot;
  +    xmlns:redirect=&quot;org.apache.xalan.xslt.extensions.Redirect&quot;
  +    extension-element-prefixes=&quot;redirect&quot;&gt;
   
  -<P>For extension namespaces implemented using Java, a special
  -convenience is supported which allows the programmer to skip the
  -component specification. This is described later in the semantics
  -of how a component description is located and loaded.</P>
  -</FONT></TD></TR></TABLE><BR>
  -
  -<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Locating Xalan-Java Components</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resourc
es/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  -   <P>When Xalan-Java encounters the extension-element-prefixes attribute on a stylesheet, it uses the
  -      following algorithm to find and load the components to handle those extension namespaces:</P>
  -      <OL>
  -        <LI> For each extension namespace, search for an &lt;<B>lxslt:component</B>&gt;
  -                element with a <B>prefix</B> attribute whose
  -                value matches the extension namespace prefix. If none is found, proceed to
  -                step 2.</LI>
  -            <LI>Treat the URI of the namespace as a fully
  -                qualified class name and attempt to
  -                load that class. If the URI starts with
  -                &quot;class:&quot;, strip that prefix
  -                before attempting to load the class. If the class
  -                loads, assume the following component description:
  -                <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>  &lt;lxslt:component prefix=&quot;prefix-being-searched-for&quot;&gt; 
  -    &lt;lxslt:script lang=&quot;javaclass&quot; src=&quot;namespaceURI&quot;/&gt;
  -  &lt;/lxslt:component&gt;</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>  
  -                <P>Assume, that is, a component implementation in Java
  -                with a source URL value of the namespace URI
  -                as the fully qualified class name. No elements and functions are defined -
  -                which means that if one were to test this
  -                namespace (via extension-element-available or
  -                extension-function-available) then the tests
  -                would fail. However, if a function or element is
  -                invoked on this extension namespace the call
  -                succeeds or fails depending on whether or not the
  -                requisite functions (as defined below) were
  -                defined by the class.</P>
  -            </LI>
  -            <LI>Treat the URI of the namespace as a URL and
  -                attempt to load the component description
  -                from this URL. If found and if the
  -                lxslt:component has a &quot;namespace-uri&quot;
  -                attribute present, it <B>must</B> match the
  -                namespace URI of the extension specified in the
  -                stylesheet. If no &quot;namespace-uri&quot;
  -                attribute is present, the component is assumed to be the
  -                component specification for this namespace. [NOT
  -                FULLY IMPLEMENTED YET - NAMESPACE USAGE ISN'T
  -                CORRECT.]<BR>
  -                </LI>
  -        </OL>
  -
  -    <P>The component specification identifies the valid local
  -        parts of the extension namespace. The element and
  -        function local parts are identified separately using the <B>elements</B>
  -        and <B>functions</B> attributes, respectively. The
  -        component specification presents the code that implements
  -        these local parts using a &lt;<B>lxslt:script</B>&gt;
  -        element. The script element can inline the code or refer
  -        to an external source for the code using the <B>src</B>
  -        attribute.</P>
  -    <P>The currently supported languages are:
  -        &quot;javaclass&quot; and &quot;javascript&quot;, where
  -        &quot;javaclass&quot; is used to work with an
  -        implementation in Java and &quot;javascript&quot; refers
  -        to Netscape Rhino.</P>
  -    <P>Special case for lang=&quot;javaclass&quot;: The <B>src</B>
  -        attribute is treated as the fully qualified classname of
  -        the class which handles the extension namespace. If the
  -        name starts with &quot;<B>class:</B>&quot;,
  -        then the class is not instantiated and the methods
  -        invoked to handle various local parts (see below) are
  -        assumed to be static. Otherwise, a new instance is
  -        created and used for invoking the appropriate methods as
  -        defined below.</P>
  -    <P>The <B>src</B> attribute is not yet implemented for
  -        languages other than &quot;javaclass&quot;.</P>
  -    <P>For each extension element within the namespace, a
  -        function with the following signature must be defined in
  -        the implementation of the component:</P>
  -<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>Object &lt;localPart&gt; (org.apache.xalan.xslt.XSLProcessorContext,
  -                      org.w3c.dom.Element extensionElement)</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  -        <P>where &lt;localPart&gt; is the local part of the
  -        extension element name. If the component is implemented
  -        in a loosely typed scripting language such as JavaScript,
  -        then these are untyped arguments to the function and the
  -        return type is unspecified as well. Note that for
  -        lang==&quot;javaclass&quot;, methods may be static or
  -        not-static and must be public in order to be accessible.</P>
  -    <P>When an extension element is invoked, the appropriate
  -        function (as identified above) is invoked to handle the
  -        invocation. The entire extension element is given as the
  -        second argument to the function with content, if any,
  -        as-is. Thus, if within an extension element one were to
  -        place elements from the xsl: namespace, then those would
  -        have to be processed by an explicit evaluation request from
  -        the extension element handler. Such invocations are done
  -        via the XSLProcessorContext object. [CALLING BACK INTO
  -        XSLProcessor.java NOT IMPLEMENTED YET.]</P>
  -    <P>For each extension function within the namespace, a
  -        function with the following signature must be defined in
  -        the implementation of the component:</P>
  -        <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>  Object &lt;localPart&gt; (Type1 arg1, Type2 arg2, ..., Typen argn)</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"
></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  -        <P>where &lt;localPart&gt; is the local part of the
  -        extension function name. The type of each argument
  -        depends on what was given within XSLT in the invocation
  -        of the function. Here is the mapping from an XSLT data
  -        type to the Java data types that are used in invoking the
  -        methods:</P>
  -        <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
  -            <TR>
  -                <TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B>XSLT Type</B>&nbsp;
  -      </FONT></TD>
  -                <TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B>Java Type</B>&nbsp;
  -      </FONT></TD>
  -            </TR>
  -            <TR>
  -                <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Node-Set&nbsp;
  -      </FONT></TD>
  -                <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">org.w3c.dom.NodeList&nbsp;
  -      </FONT></TD>
  -            </TR>
  -            <TR>
  -                <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">String&nbsp;
  -      </FONT></TD>
  -                <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">java.lang.String&nbsp;
  -      </FONT></TD>
  -            </TR>
  -            <TR>
  -                <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Boolean&nbsp;
  -      </FONT></TD>
  -                <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">boolean or Boolean&nbsp;
  -      </FONT></TD>
  -            </TR>
  -            <TR>
  -                <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Number&nbsp;
  -      </FONT></TD>
  -                <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">double or Double&nbsp;
  -      </FONT></TD>
  -            </TR>
  -            <TR>
  -                <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Result Tree Fragment&nbsp;
  -      </FONT></TD>
  -                <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">org.w3c.dom.DocumentFragment&nbsp;
  -      </FONT></TD>
  -            </TR>
  -            <TR>
  -                <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">variable&nbsp;
  -      </FONT></TD>
  -                <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">one of above based on <BR>
  -                type of variable's value&nbsp;
  -      </FONT></TD>
  -            </TR>
  -        </TABLE>
  -        <P>For boolean and number XSLT types,
  -        first all such types are converted to the corresponding
  -        primitive type in Java and the method searched for. If
  -        the method is not found, then a method with the object
  -        types is searched for. For example foo:bar('a'='b', 1,
  -        'Hello', 2) would first look for a method
  -        bar(boolean,double,String,boolean) and then for
  -        bar(Boolean,Double,String,Double).</P>
  -        <P>If the component is implemented in a loosely typed
  -        scripting language such as JavaScript, then these are
  -        untyped arguments to the function and the return type is
  -        unspecified as well.</P>
  -    <P>When an extension function is invoked, the appropriate
  -        function (as identified above) is invoked to handle the
  -        invocation. Any arguments to the function are first
  -        evaluated and then the resulting values are passed to the
  -        function by first converting them according to the table
  -        listed above.</P>
  -    <P>To control how a stylesheet behaves if an extension is not available, create an xsl:fallback element with 
  -       xsl:choose or xsl:if instructions and the element-available and extension-available functions.</P>
  -</FONT></TD></TR></TABLE><BR>
  -<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Special Handling for Extensions into Java</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" s
rc="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  -
  -<P>When a qualified function name is invoked, if the
  -namespace is not already registered as an extension namespace (by
  -the above mechanism), Xalan-Java treats the URI of the namespace as a fully qualified class
  -name and attempts to load that class. If the URI starts
  -with &quot;class:&quot;, Xalan-Java strips that prefix before
  -attempting to load the class. If class loading succeeds, then an
  -extension namespace implemented in &quot;javaclass&quot; is
  -assumed with the URI as the value of the src attribute. Note that
  -no functions are defined - which means that if one were to test
  -this namespace (via extension-function-available) then the tests
  -would fail. However, if a function is invoked on this extension
  -namespace, the call succeeds or fails depending on whether or not the
  -requisite functions (as defined above) were defined by the class.</P>
  -</FONT></TD></TR></TABLE><BR>
  -<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Predefined Extension Namespace for Java Access</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace=
"0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  -<P>Xalan-Java supports a special namespace for convenient
  -interaction with Java objects. The namespace URI is &quot;http://xsl.lotus.com/java&quot;.
  -This namespace allows the stylesheet author to create new
  -instances of Java classes and to invoke static and non-static
  -methods on them. Assuming, the namespace declaration &quot;<B>xmlns:java='http://xsl.lotus.com/java'</B>&quot;
  -is in scope, the following are supported:</P>
  -<P>java:<I>FQCN</I>.<B>new</B> (<I>args</I>)</P>
  -
  -<P>where FQCN is the fully qualified class name of which a new
  -instance is to be created with the given constructor arguments
  -(if any).</P>
  -
  -<P>java:<I>FQCN.methodName</I> (<I>args</I>)</P>
  -
  -<P>where <I>FQCN</I> is the fully qualified class name whose
  -static method &quot;<I>methodName</I>&quot; is to be invoked
  -using the given arguments. </P>
  -
  -<P>java:<I>methodName</I> (<I>object</I>, <I>args</I>)</P>
  -
  -<P>where <I>methodName</I> is the name of the (static or
  -non-static) method to invoke on <I>object</I> with the given
  -arguments.</P>
  -</FONT></TD></TR></TABLE><BR>
  -<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Passing Nodes to java</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.g
if" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  -<P>If you want to pass one or more Nodes to an extension function, set up a Java method to accept an 
  -org.w3c.dom.NodeList (or an org.apache.xalan.xpath.MutableNodeList, which extends NodeList, if you want to modify the Nodes).</P>
  -<P>When you call an extension function with an argument that constitutes a pattern match for one or more Nodes, the Xalan-Java extension mechanism evaluates this argument as a NodeList, even if only one Node is involved.</P>
  -<P>Suppose, for example, you have a myExtensions.ProcessNodes class with the following doSomething method:</P>
  -<P><CODE><FONT face="courier, monospaced">doSomething(org.w3c.dom.NodeList nList)</FONT></CODE></P>
  -<P>Any of the following extension calls in a stylesheet are syntatically possible:</P>
  -<P><CODE><FONT face="courier, monospaced">java:MyExtensions.ProcessNodes.doSomething(.) &lt;!-- current node --&gt;</FONT></CODE></P>
  -<P><CODE><FONT face="courier, monospaced">java:MyExtensions.ProcessNodes.doSomething(*) &lt;!-- all nodes in current context--&gt;</FONT></CODE></P>
  -<P><CODE><FONT face="courier, monospaced">java:MyExtensions.ProcessNodes.doSomething(/*) &lt;!-- all nodes --&gt;</FONT></CODE></P>
  -<P><CODE><FONT face="courier, monospaced">java:MyExtensions.ProcessNodes.doSomething(foo/baz) &lt;!-- foo/baz nodes in current context --&gt;</FONT></CODE></P>
  -<P><CODE><FONT face="courier, monospaced">java:MyExtensions.ProcessNodes.doSomething(/foo/baz | /bar/saz) &lt;!-- /foo/baz and /bar/saz nodes --&gt;</FONT></CODE></P>
  -<P>The NodeList is in fact a list of references into the XML document, so keep in mind that getNextSibling(), for example, gets you the next sibling in the document, wich may not be the next Node in the NodeList.</P>
  +  &lt;xsl:template match=&quot;/&quot;&gt;
  +    &lt;standard-out&gt;
  +      Standard output:
  +      &lt;xsl:apply-templates/&gt;
  +    &lt;/standard-out&gt;
  +  &lt;/xsl:template&gt;
  +  
  +  &lt;xsl:template match=&quot;main&quot;&gt;
  +    &lt;main&gt;
  +      &lt;xsl:apply-templates/&gt;
  +    &lt;/main&gt;
  +  &lt;/xsl:template&gt;
  +  
  +  &lt;xsl:template match=&quot;/doc/foo&quot;&gt;
  +    &lt;redirect:write select=&quot;@file&quot;&gt;
  +      &lt;foo-out&gt;
  +        &lt;xsl:apply-templates/&gt;
  +      &lt;/foo-out&gt;
  +    &lt;/redirect:write&gt;
  +  &lt;/xsl:template&gt;
  +  
  +  &lt;xsl:template match=&quot;bar&quot;&gt;
  +    &lt;foobar-out&gt;
  +      &lt;xsl:apply-templates/&gt;
  +    &lt;/foobar-out&gt;
  +  &lt;/xsl:template&gt;
  +  
  +&lt;/xsl:stylesheet&gt;</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  +<P>The standard output is:</P>
  +<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  +&lt;standard-out&gt;
  +  Standard output:
  +  &lt;main&gt;
  +    Everything else.
  +  &lt;/main&gt;
  +&lt;standard-out&gt;</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  +<P>The output redirected to foo.out is:</P>
  +<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  +&lt;foo-out&gt;
  +    Testing Redirect extension:
  +    &lt;foobar-out&gt;foo subelement text node&lt;/foobar-out&gt;
  +  &lt;/foo-out&gt;</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  +<P>For more information on using the Redirect extension to send output to mulitple files, see <A href="apidocs/org/apache/xalan/xslt/extensions/Redirect.html" target="_top">Redirect class</A>.</P>  
  +</FONT></TD></TR></TABLE><BR>
  +</FONT></TD></TR></TABLE><BR><A name="ext-functions"><!--anchor--></A>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Using extension functions</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/vo
id.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  +<P>Extension functions may include arguments of any type and return a value of any type.</P>
  +<P>XSLT recognizes five data types: node-set, result-tree-fragment, string, boolean, and number. You can use XPath expressions to set variables with values of these types. You can also pass literals for string, boolean, and number arguments. If you want to pass an argument of a type that XSLT does not recognize, use another extension function to return an object of that type. The stylesheet that appears in <A href="#format-date-stylesheet">Formatting a date</A>, for example uses extension functions to return a Date object and a SimpleDateFormat object, and then uses these objects to call another extension function.</P>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Data type mapping</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
 width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P>The XSLT data types map to Java data types as follows:</P>
  +  <TABLE border="0" cellpadding="2" cellspacing="2" width="100%">
  +    <TR>
  +      <TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B>XSLT Type</B>&nbsp;
  +      </FONT></TD>
  +      <TD align="center" bgcolor="#039acc" colspan="1" rowspan="1" valign="center"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="-1"><B>Java Type</B>&nbsp;
  +      </FONT></TD>
  +    </TR>
  +    <TR>
  +       <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Node-Set&nbsp;
  +      </FONT></TD>
  +       <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">org.w3c.dom.NodeList&nbsp;
  +      </FONT></TD>
  +    </TR>
  +    <TR>
  +       <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">String&nbsp;
  +      </FONT></TD>
  +       <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">java.lang.String&nbsp;
  +      </FONT></TD>
  +    </TR>
  +    <TR>
  +       <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Boolean&nbsp;
  +      </FONT></TD>
  +       <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">boolean or Boolean&nbsp;
  +      </FONT></TD>
  +    </TR>
  +    <TR>
  +       <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Number&nbsp;
  +      </FONT></TD>
  +       <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">double or Double&nbsp;
  +      </FONT></TD>
  +    </TR>
  +    <TR>
  +       <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">Result Tree Fragment&nbsp;
  +      </FONT></TD>
  +       <TD align="left" bgcolor="#a0ddf0" colspan="1" rowspan="1" valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">org.w3c.dom.DocumentFragment&nbsp;
  +      </FONT></TD>
  +    </TR>
  +  </TABLE>
  +<P>For the XSLT boolean and number types, Xalan first looks for a method with the corresponding Java primitive type. If it does not find such a method, it looks for a method with the object type. In the case of the foo:bar(10) static method call, for example, Xalan first looks for bar(double). If it does not find such a method, it looks for for bar(java.lang.Double).</P>
  +<P>When an extension function is invoked, the arguments are converted as indicated above, and sent to the extension. No conversion takes place for arguments of non-XSLT types.</P>
  +<A name="ext-func-calls"><!--anchor--></A>
   </FONT></TD></TR></TABLE><BR>
  -<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Example 1: Named Counter Component in Java</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" 
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Extension function Java calls</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif
" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P>Use the following syntax to instantiate Java objects and to call methods:</P>
  +<P><CODE><FONT face="courier, monospaced"><I>prefix</I>:<I>FQCN</I>.new (<I>args</I>)</FONT></CODE></P>
  +
  +<P>where <I>prefix</I> is the extension namespace prefix and <I>FQCN</I> is the fully qualified class name of which a new instance is to be created with the <I>args</I> constructor arguments (if any).</P>
   
  -<P>MyCounter.java:</P>
  +<P><CODE><FONT face="courier, monospaced"><I>prefix</I>:<I>FQCN.methodName</I> (<I>args</I>)</FONT></CODE></P>
   
  -<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>  import java.util.*;
  +<P>where <I>FQCN</I> is the fully qualified class name whose static method <I>methodName</I> is to be invoked using the <I>args</I> arguments. </P>
   
  +<P><CODE><FONT face="courier, monospaced"><I>prefix</I>:<I>methodName</I> (<I>object</I>, <I>args</I>)</FONT></CODE></P>
  +
  +<P>where <I>methodName</I> is the name of the method to invoke on <I>object</I> with the <I>args</I> arguments.</P>
  +</FONT></TD></TR></TABLE><BR>
  +
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Passing Nodes to java</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace
="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P>Please keep in mind that <B>all</B> LocationPath expressions return a node-set, even if the expression only returns a single attribute or a text node (node-sets with one member). You can use the XSLT string() function to convert a node-set value to string, and the number() function to convert a node-set value to number (a double).</P>
  +<P>If you want to pass a node-list to an extension function, set up a Java method to accept an 
  +org.w3c.dom.NodeList (or an org.apache.xalan.xpath.MutableNodeList, which extends NodeList, if you want to modify the nodes).</P>
  +<P>Suppose, for example, you have a myExtensions.ProcessNodes class with the following doSomething method:</P>
  +<P><CODE><FONT face="courier, monospaced">public static void doSomething(org.w3c.dom.NodeList nList)</FONT></CODE></P>
  +<P>Assuming you set up this extension in the node-ext namespace, any of the following extension calls from a stylesheet are syntatically possible:</P>
  +<P><CODE><FONT face="courier, monospaced">&lt;!--Process the current node--&gt;</FONT></CODE><BR>
  +<CODE><FONT face="courier, monospaced">node-ext:MyExtensions.ProcessNodes.doSomething(.)</FONT></CODE></P>
  +<P><CODE><FONT face="courier, monospaced">&lt;!--Process all nodes in current context--&gt;</FONT></CODE><BR>
  +<CODE><FONT face="courier, monospaced">node-ext:MyExtensions.ProcessNodes.doSomething(*)</FONT></CODE></P>
  +<P><CODE><FONT face="courier, monospaced">&lt;!-- Process all nodes --&gt;</FONT></CODE><BR>
  +<CODE><FONT face="courier, monospaced">node-ext:MyExtensions.ProcessNodes.doSomething(/*)</FONT></CODE></P>
  +<P><CODE><FONT face="courier, monospaced">&lt;!--Process the foo/baz nodes in current context --&gt;</FONT></CODE><BR>
  +<CODE><FONT face="courier, monospaced">node-ext:MyExtensions.ProcessNodes.doSomething(foo/baz)</FONT></CODE></P>
  +<P><CODE><FONT face="courier, monospaced">&lt;!--Process the/foo/baz and /bar/saz nodes --&gt;</FONT></CODE><BR>
  +<CODE><FONT face="courier, monospaced">node-ext:MyExtensions.ProcessNodes.doSomething(/foo/baz | /bar/saz)</FONT></CODE></P>
  +<P>The NodeList is in fact a list of references into the XML document, so keep in mind that getNextSibling(), for example, gets you the next sibling in the document, which may not be the next Node in the NodeList.</P>
  +</FONT></TD></TR></TABLE><BR>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Implementing extension functions</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.
gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P>For each extension function in a namespace, the implementation must include a Java method with the following signature, or the scripting language equivalent:</P>
  +<P><CODE><FONT face="courier, monospaced">public <I> object function</I>(<I>args</I>)</FONT></CODE></P>
  +<P>where <I>object</I> is the return type, <I>function</I> is the local part of the extension function name (the function name without the namespace prefix), and <I>args</I> correspond to the arguments in the function call.</P>
  +</FONT></TD></TR></TABLE><BR>
  +</FONT></TD></TR></TABLE><BR><A name="java-namespace"><!--anchor--></A>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Alternative: using the predefined java extension namespace</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height
="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  +<P>For extension functions implemented in Java, Xalan provides a java namespace. When you declare and use the java namespace, you do not use an lxslt:component to designate the functions.</P>
  +<P>The java namespace supports the use of extension functions implemented in Java. You cannot use this syntax with extension elements or with extensions implemented in JavaScript or another scripting language.</P>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Declare the Xalan java namespace</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.
gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P><CODE><FONT face="courier, monospaced">xmlns:lxslt=&quot;http://xml.apache.org/java&quot;</FONT></CODE></P>
  +<TABLE border="0" cellpadding="0" cellspacing="3" width="100%"><TR><TD valign="top" width="20"><IMG alt="Note" border="0" height="24" hspace="0" src="resources/note.gif" vspace="0" width="20"></TD><TD valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><I>You may also use the LotusXSL alias for this namespace: &quot;http://xsl.lotus.com/java&quot;.</I></FONT></TD></TR></TABLE>
  +</FONT></TD></TR></TABLE><BR>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Use the java namespace when you make extension function calls</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hs
pace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P>Use &quot;java&quot; as the prefix with the syntax described in <A href="#ext-func-calls">Extension function Java calls</A>.</P>
  +<P>That is all. You do not need to set an extension-element-prefixes attribute, and you do not include an xslt:component element. Given the absence of the lxslt:component element, you cannot use the function-available method to determine at runtime whether a Java method call is actually available. </P>
  +<P>Using the java namespace clearly involves less setup than using your own namespace, as long as these restrictions are not a probleem. Remember that you always have the option of setting up your own namespace and extra overhead is really minimal.</P>
  +</FONT></TD></TR></TABLE><BR><A name="ex-java-namespace"><!--anchor--></A> 
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Example: Formatting a date</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" v
space="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P>This example uses extension functions to call the SimpleDateFormat class and the IntDate class. IntDate uses String arguments to set up a Date object:</P>
  +<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>import java.util.Date;
  +import java.util.Calendar;
  +
  +public class IntDate
  +{
  +  public static Date getDate(String year, String month, String day)
  +    {
  +      // Date(int, int, int) has been deprecated, so use Calendar to
  +      // set the year, month, and day.
  +      Calendar c = Calendar.getInstance();
  +      // Cast each argument to int.
  +      c.set(Integer.parseInt(year),Integer.parseInt(month),Integer.parseInt(day));
  +      return c.getTime();
  +    }
  +}</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  +<P>The template transforms date elements with four attributes. For example, it transforms <CODE><FONT face="courier, monospaced">&lt;date format=&quot;EEEE, MMM dd, yyyy&quot; year=&quot;2000&quot; month=&quot;4&quot; day=&quot;27&quot;/&gt;</FONT></CODE> into &lt;p&gt;Date: Thursday, April 27, 2000.&lt;/p&gt;.</P>
  +<P>As you review this stylesheet, please keep the following in mind:</P>
  + <UL>
  +  <LI>The exclude-result-prefixes stylesheet attribute prevents the java namespace declaration from
  +   appearing in the output.</LI>
  +  <LI>The XSLT type returned by any LocationPath expression is node-set, so the XSLT string
  +    function is used to convert the format, year, month, and day attribute node-set values to
  +    strings.</LI>
  +  <LI>The format attribute provides a String argument for constructing a java.text.SimpleDateFormat
  +    object.</LI>
  +    <LI>The IntDate class uses String values provided by the year, month, and day attributes, to set the
  +    date. XSLT can pass number values, but these are converted into doubles.</LI>
  +  <LI>The formatter variable holds a SimpleDateFormat object, and the date variable holds a Date object.
  +    XSLT does not understand either of these types, but they are used to call the SimpleDateFormat format
  +     method. In that call, $formatter is the object, and $date is the argument. The syntax for calling
  +     Java constructors and methods is described above in <A href="#ext-func-calls">Extension function Java calls</A>.</LI>    
  + </UL><A name="format-date-stylesheet"><!--anchor--></A>   
  +<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>&lt;?xml version=&quot;1.0&quot;?&gt;
  +&lt;xsl:stylesheet 
  +    xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; 
  +    version=&quot;1.0&quot;   
  +    xmlns:java=&quot;http://xml.apache.org/xslt/java&quot;
  +    exclude-result-prefixes=&quot;java&quot;&gt;
  +    
  +  &lt;!--Other templates for transforming the rest of the XML source documents--&gt;
  +  
  +  &lt;xsl:template match=&quot;date&quot;&gt; 
  +    &lt;xsl:variable name=&quot;year&quot; select=&quot;string(./@year)&quot;/&gt;
  +    &lt;xsl:variable name=&quot;month&quot; select=&quot;string(./@month)&quot;/&gt; 
  +    &lt;xsl:variable name=&quot;day&quot; select=&quot;string(./@day)&quot;/&gt;          
  +    &lt;xsl:variable name=&quot;format&quot; select=&quot;string(./@format)&quot;/&gt;
  +
  +    &lt;xsl:variable name=&quot;formatter&quot;       
  +        select=&quot;java:java.text.SimpleDateFormat.new($format)&quot;/&gt;
  +
  +    &lt;xsl:variable name=&quot;date&quot; 
  +        select=&quot;java:IntDate.getDate($year, $month, $day)&quot;/&gt;
  +
  +    &lt;p&gt;Date: &lt;xsl:value-of select=&quot;java:format($formatter, $date)&quot;/&gt;&lt;/p&gt;
  +  &lt;/xsl:template&gt;
  +&lt;/xsl:stylesheet&gt;  
  +</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  +</FONT></TD></TR></TABLE><BR>
  +</FONT></TD></TR></TABLE><BR>
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Examples: using Java and JavaScript to implement the same extension</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="
0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  +<P>This section contains two examples. The first example uses a Java extension to transform a set of name elements  into an alphabetical and numbered list. The second example uses a JavaScript script to do the same. Both examples include equivalent extension elements and an extension function.</P>
  +<A name="ex-java"><!--anchor--></A> 
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Java implementation</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="
0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P>MyCounter.java</P>
  +<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>mport java.util.*;
  +
   public class MyCounter {
     Hashtable counters = new Hashtable ();
   
  -  public MyCounter () {
  -  }
  +  public MyCounter () 
  +  {}
   
  -  // the context arg is actually a org.apache.xalan.xslt.XSLProcessorContext
  -  public void init (Object context, org.w3c.dom.Element elem) {
  -    String name = elem.getAttribute (&quot;name&quot;);
  -    String value = elem.getAttribute (&quot;value&quot;);
  +  public void init(org.apache.xalan.xslt.XSLProcessorContext context, 
  +                   org.apache.xalan.xslt.ElemExtensionCall extElem) 
  +  {
  +    String name = extElem.getAttribute(&quot;name&quot;);
  +    String value = extElem.getAttribute(&quot;value&quot;);
       int val;
  -    try {
  +    try 
  +    {
         val = Integer.parseInt (value);
  -    } catch (NumberFormatException e) {
  +    } 
  +    catch (NumberFormatException e) 
  +    {
         e.printStackTrace ();
         val = 0;
       }
       counters.put (name, new Integer (val));
     }
   
  -  public int read (String name) {
  +  public int read(String name) 
  +  {
       Integer cval = (Integer) counters.get (name);
       return (cval == null) ? 0 : cval.intValue ();
     }
   
  -  public void incr(Object context, org.w3c.dom.Element elem) {
  -    String name = elem.getAttribute (&quot;name&quot;);
  -    Integer cval = (Integer) counters.get (name);
  +  public void incr(org.apache.xalan.xslt.XSLProcessorContext context, 
  +                   org.apache.xalan.xslt.ElemExtensionCall extElem) {
  +    String name = extElem.getAttribute(&quot;name&quot;);
  +    Integer cval = (Integer) counters.get(name);
       int nval = (cval == null) ? 0 : (cval.intValue () + 1);
       counters.put (name, new Integer (nval));
     }
  -}</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  -
  -<P>MyFamily.xml:</P>
  -
  +}
  +</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  +<P>An XML source document:</P>
   <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>&lt;?xml version=&quot;1.0&quot;?&gt;
  -
   &lt;doc&gt;
  -  &lt;name first=&quot;Sanjiva&quot; last=&quot;Weerawarana&quot;/&gt;
  -  &lt;name first=&quot;Shahani&quot; last=&quot;Weerawarana&quot;/&gt;
  -  &lt;name first=&quot;Rukmal&quot; last=&quot;Weerawarana&quot;/&gt;
  -  &lt;name first=&quot;Sashi&quot; last=&quot;Weerawarana&quot;/&gt;
  -  &lt;name first=&quot;Kamal&quot; last=&quot;Fernando&quot;/&gt;
  -  &lt;name first=&quot;Ruby&quot; last=&quot;Fernando&quot;/&gt;
  +  &lt;name first=&quot;David&quot; last=&quot;Marston&quot;/&gt;
  +  &lt;name first=&quot;David&quot; last=&quot;Bertoni&quot;/&gt;
  +  &lt;name first=&quot;Donald&quot; last=&quot;Leslie&quot;/&gt;
  +  &lt;name first=&quot;Emily&quot; last=&quot;Farmer&quot;/&gt;
  +  &lt;name first=&quot;Jack&quot; last=&quot;Donohue&quot;/&gt;
  +  &lt;name first=&quot;Myriam&quot; last=&quot;Midy&quot;/&gt;
  +  &lt;name first=&quot;Paul&quot; last=&quot;Dick&quot;/&gt;
  +  &lt;name first=&quot;Robert&quot; last=&quot;Weir&quot;/&gt;
  +  &lt;name first=&quot;Scott&quot; last=&quot;Boag&quot;/&gt;
  +  &lt;name first=&quot;Shane&quot; last=&quot;Curcuru&quot;/&gt;
   &lt;/doc&gt;</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  -
  -<P>Counter.xsl:</P>
  -
  +<P>The stylesheet:</P>
   <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>&lt;?xml version=&quot;1.0&quot;?&gt; 
  -
   &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  -                xmlns:lxslt=&quot;http://xsl.lotus.com/&quot;
  +                xmlns:lxslt=&quot;http://xml.apache.org/xslt&quot;
                   xmlns:counter=&quot;MyCounter&quot;
  -                extension-element-prefixes=&quot;counter&quot;&gt;
  +                extension-element-prefixes=&quot;counter&quot;
  +                version=&quot;1.0&quot;&gt;
   
  -  &lt;!-- note that the component definition is optional because I
  -       used the fully qualified class name of the implementation
  -       as the URI for this namespace. --&gt;
     &lt;lxslt:component prefix=&quot;counter&quot;
                      elements=&quot;init incr&quot; functions=&quot;read&quot;&gt;
       &lt;lxslt:script lang=&quot;javaclass&quot; src=&quot;MyCounter&quot;/&gt;
  @@ -469,9 +544,8 @@
   
     &lt;xsl:template match=&quot;/&quot;&gt;
       &lt;HTML&gt;
  -      &lt;H1&gt;Test for namespace specified Java extension.&lt;/H1&gt;
  +      &lt;H1&gt;Names in alphabetical order&lt;/H1&gt;
         &lt;counter:init name=&quot;index&quot; value=&quot;1&quot;/&gt;
  -      &lt;p&gt;Here are the names in alphabetical order by last name:&lt;/p&gt;
         &lt;xsl:for-each select=&quot;doc/name&quot;&gt;
           &lt;xsl:sort select=&quot;@last&quot;/&gt;
           &lt;xsl:sort select=&quot;@first&quot;/&gt;
  @@ -488,66 +562,84 @@
       &lt;/HTML&gt;
     &lt;/xsl:template&gt;
    
  -&lt;/xsl:stylesheet&gt;</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  -
  -<P>Output:</P>
  -
  +&lt;/xsl:stylesheet&gt;
  +</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  +<P>Transformation output:</P>
   <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>&lt;HTML&gt;
  -  &lt;H1&gt;Test for namespace specified Java extension.&lt;/H1&gt;
  -  &lt;p&gt;Here are the names in alphabetical order by last name, first name:&lt;/p&gt;
  -  &lt;p&gt;[1]. Fernando, Kamal&lt;/p&gt;
  -  &lt;p&gt;[2]. Fernando, Ruby&lt;/p&gt;
  -  &lt;p&gt;[3]. Weerawarana, Rukmal&lt;/p&gt;
  -  &lt;p&gt;[4]. Weerawarana, Sanjiva&lt;/p&gt;
  -  &lt;p&gt;[5]. Weerawarana, Sashi&lt;/p&gt;
  -  &lt;p&gt;[6]. Weerawarana, Shahani&lt;/p&gt;
  +&lt;H1&gt;Names in alphabetical order&lt;/H1&gt;
  +&lt;p&gt;[1]. Bertoni, David&lt;/p&gt;
  +&lt;p&gt;[2]. Boag, Scott&lt;/p&gt;
  +&lt;p&gt;[3]. Curcuru, Shane&lt;/p&gt;
  +&lt;p&gt;[4]. Dick, Paul&lt;/p&gt;
  +&lt;p&gt;[5]. Donohue, Jack&lt;/p&gt;
  +&lt;p&gt;[6]. Farmer, Emily&lt;/p&gt;
  +&lt;p&gt;[7]. Leslie, Donald&lt;/p&gt;
  +&lt;p&gt;[8]. Marston, David&lt;/p&gt;
  +&lt;p&gt;[9]. Midy, Myriam&lt;/p&gt;
  +&lt;p&gt;[10]. Weir, Robert&lt;/p&gt;
   &lt;/HTML&gt;</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  -</FONT></TD></TR></TABLE><BR>
  -<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Example 2: Named Counter Component Implemented Using Java XPath Extension Namespace</B></FONT></TD><TD bgcolor="#017299" width="
1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  +</FONT></TD></TR></TABLE><BR><A name="ex-javascript"><!--anchor--></A> 
  +<TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>JavaScript implementation</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vs
pace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
  +<P></P>
  +<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>&lt;?xml version=&quot;1.0&quot;?&gt; 
  +&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  +                xmlns:lxslt=&quot;http://xml.apache.org/xslt&quot;
  +                xmlns:counter=&quot;MyCounter&quot;
  +                extension-element-prefixes=&quot;counter&quot;
  +                version=&quot;1.0&quot;&gt;
   
  -<P>Counter.xsl:</P>
  +  &lt;lxslt:component prefix=&quot;counter&quot;
  +                   elements=&quot;init incr&quot; functions=&quot;read&quot;&gt;
  +    &lt;lxslt:script lang=&quot;javascript&quot;&gt;
  +      var counters = new Array();
   
  -<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>&lt;?xml version=&quot;1.0&quot;?&gt; 
  +      function init (xslproc, elem) {
  +        name = elem.getAttribute (&quot;name&quot;);
  +        value = parseInt(elem.getAttribute (&quot;value&quot;));
  +        counters[name] = value;
  +        return null;
  +      }
   
  -&lt;!-- named counter functionality done using java: --&gt;
  +      function read (name) {
  +        // Return a string.
  +        return &quot;&quot; + (counters[name]);
  +      }
   
  -&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  -                xmlns:java=&quot;http://xsl.lotus.com/java&quot;&gt;
  +      function incr (xslproc, elem)
  +      {
  +        name = elem.getAttribute (&quot;name&quot;);
  +        counters[name]++;
  +        return null;
  +      }
  +    &lt;/lxslt:script&gt;
  +  &lt;/lxslt:component&gt;
   
     &lt;xsl:template match=&quot;/&quot;&gt;
       &lt;HTML&gt;
  -      &lt;H1&gt;Test for namespace specified Java extension.&lt;/H1&gt;
  -      &lt;xsl:variable name=&quot;counter-table&quot; 
  -                    select=&quot;java:java.util.Hashtable.new ()&quot;/&gt;
  -      &lt;!-- do following for side-effect --&gt;
  -      &lt;xsl:if test=&quot;java:put ($counter-table, 'index', 1)&quot;/&gt;
  -      &lt;p&gt;Here are the names in alphabetical order by last name, first name:&lt;/p&gt;
  +      &lt;H1&gt;Names in alphatebical order&lt;/H1&gt;
  +      &lt;counter:init name=&quot;index&quot; value=&quot;1&quot;/&gt;
         &lt;xsl:for-each select=&quot;doc/name&quot;&gt;
           &lt;xsl:sort select=&quot;@last&quot;/&gt;
           &lt;xsl:sort select=&quot;@first&quot;/&gt;
           &lt;p&gt;
           &lt;xsl:text&gt;[&lt;/xsl:text&gt;
  -        &lt;xsl:value-of select=&quot;java:get ($counter-table, 'index')&quot;/&gt;
  +        &lt;xsl:value-of select=&quot;counter:read('index')&quot;/&gt;
           &lt;xsl:text&gt;]. &lt;/xsl:text&gt;
           &lt;xsl:value-of select=&quot;@last&quot;/&gt;
           &lt;xsl:text&gt;, &lt;/xsl:text&gt;
           &lt;xsl:value-of select=&quot;@first&quot;/&gt;
           &lt;/p&gt;
  -        &lt;!-- do following for side-effect --&gt;
  -        &lt;xsl:if test=&quot;java:put ($counter-table, 'index',
  -                                java:get($counter-table,'index')+1)&quot;/&gt;
  +        &lt;counter:incr name=&quot;index&quot;/&gt;
         &lt;/xsl:for-each&gt;
       &lt;/HTML&gt;
     &lt;/xsl:template&gt;
    
  -&lt;/xsl:stylesheet&gt;</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  -
  -<P>Produces the same results.</P>
  +&lt;/xsl:stylesheet&gt;
  +</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
  +<P>This stylesheet produces the same output as the preceding example with the Java extension.</P>
   </FONT></TD></TR></TABLE><BR>
  -<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Example 3: Redirecting transformation output to multiple files</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" he
ight="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
  -<P>For information on using the Redirect extension to send output to mulitple files, see <A href="apidocs/org/apache/xalan/xslt/extensions/Redirect.html" target="_top">Redirect class</A>.</P>
   </FONT></TD></TR></TABLE><BR>
   </TD></TR></TABLE></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD bgcolor="#0086b2"><IMG height="1" src="images/dot.gif" width="1"></TD></TR><TR><TD align="center"><FONT color="#0086b2" size="-1"><I>
  -              Copyright &copy; 1999 The Apache Software Foundation.
  +              Copyright &copy; 2000 The Apache Software Foundation.
                 All Rights Reserved.
               </I></FONT></TD></TR></TABLE></BODY></HTML>
  
  
  

Mime
View raw message