[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl:script and Xalan ?

Subject: Re: xsl:script and Xalan ?
From: Warren Hedley <w.hedley@xxxxxxxxxxxxxx>
Date: Fri, 16 Jun 2000 09:19:50 -0400
xalan nbsp xsl
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 &nbsp;.

<xsl:template name="Filter">
  <xsl:param name="input_text" />
  <xsl:value-of select="translate($input_text, ' ', '&#160;')" />
</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">&lt;/TR&gt;</xsl:text>

Hope this helps.

-- 
Warren Hedley


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.