Re: [xsl] XSL + Java extensions + Xalan

Subject: Re: [xsl] XSL + Java extensions + Xalan
From: "Mattio Valentino" <xmlhack@xxxxxxxxxxx>
Date: Fri, 13 Jul 2001 12:27:24 -0000
Thanks Jean!

Actually, our Sr. Project Manager/über-developer was able to get it to work.

Relevant XSLT tagging:

<xsl:stylesheet
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
	xmlns:lxslt="http://xml.apache.org/xslt";
	xmlns:testIndent="testExtensions"
	extension-element-prefixes="testIndent"
	version="1.0">

<lxslt:component prefix="testIndent" elements="init" functions="setIndent">
	 <lxslt:script lang="javaclass" src="testExtensions"/>
</lxslt:component>

<xsl:template match="myTag">
<xsl:value-of disable-output-escaping="yes" select="testIndent:setIndent(string(@indent))" />
</xsl:template>


There was also a necessary change to either the .java file or the location of the .java file that she mentioned, but I can't remember those details off the top of my head...

From: Jean-Baptiste Quenot <jb.quenot@xxxxxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] XSL + Java extensions + Xalan
Date: Mon, 9 Jul 2001 22:27:26 +0200

* Mattio Valentino:

> Hi  all.  I'm  having some  trouble with  Java extensions.   I've been
> through the xml.apache.org documentation with no luck.
>
> I'm using: Resin, Xerces/Xalan, and JSP to serve up the XML/XSL.

The  problem  here  is  Resin.  Quoting  Scott  Ferguson  (Resin's  main
developer) from resin-interest@xxxxxxxxxx mailing list today:

« There is an extension mechanism in the current XSL draft that will let
you do the same thing.  Resin hasn't implemented it yet, but it's on the
todo list. »

I  guess   what  Scott   is  talking  about   is  exactly   the  problem
you   encounter.     However,   in   your   XSL    file,   with   Resin,
you   can   embed   java   scriptlets   using   <# ... #>   blocks   (or
<xtp:scriptlet> ... </xtp:scriptlet> if you prefer).

In fact, you can do everything you do with JSPs, but replace the '%'
character with a '#' in XSL files.

You can even import classes, using <#! page import ... #>.

Now that I explained the situation, I can quote the whole text:

« Resin-specific.   The W3C  is  ideologically opposed  to scripting  in
stylesheets  (It's  not just  the  syntax.   Using <xsl:expr>  would  be
morally wrong as well.)  There is  an extension mechanism in the current
XSL draft that will let you do the same thing.  Resin hasn't implemented
it yet,  but it's on  the todo  list.  So you'll  be able to  remove the
Resin dependency pretty soon.  »

Cheerio!
--
Jean-Baptiste Quenot

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


_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com


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



Current Thread