This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl:script and Xalan ?
- To: xsl-list at mulberrytech dot com
- Subject: Re: xsl:script and Xalan ?
- From: Warren Hedley <w dot hedley at auckland dot ac dot nz>
- Date: Fri, 16 Jun 2000 09:19:50 -0400
- Organization: Department of Engineering Science, The University of Auckland
- References: <NEBBIKOJMKPNKBIMLGKMGEDICAAA.philippe.dhont@sail.com>
- Reply-To: xsl-list at mulberrytech dot com
Hi Phillipe.
It appears I completely misinterpreted your first post, and your problem
is indeed quite complex. If you're absolutely determined to use Javascript,
there is some documentation and examples available in the online docs
in the Extensions section:
http://xml.apache.org/xalan/extensions.html
However, don't give up on pure XSLT, because almost anything
is possible - you just have to change your way of doing things.
A few notes:
You can use named templates to perform certain simple functions. You
can probably use a named template for your text filtering - the
following one replaces all spaces with .
<xsl:template name="Filter">
<xsl:param name="input_text" />
<xsl:value-of select="translate($input_text, ' ', ' ')" />
</xsl:template>
Parameters created with <xsl:variable> are not actually variable - you
can't change their value. However you can often rewrite your scripts to
use a recursive template where the parameter is changed each time you
call the template. eg:
<xsl:template name="recursive">
<xsl:param name="var" />
<!-- do some stuff -->
<xsl:call-template name="recursive">
<xsl:with-param name="var" select="$var + 1" />
</xsl:call-template>
</xsl:template>
You can almost always get away without having to generate start and
close tags using plain text output - you just have to use some
creativity in working out where the tags and templates belong in
your XSL. This kind of thing is a no-no.
document.write(ltchar + "/TR" + gtchar);
== <xsl:text disable-output-escaping="yes"></TR></xsl:text>
Hope this helps.
--
Warren Hedley
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list