|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: External processing.
> I'm wondering if it is possible in XSL to call external processing. For
> example, in a xsl:if function, I would like to add a self-defined function
> to be evaluated in the test such <xsl:if test="myFooFunction($toto)">. I've
> heard that it was possible in SGML. But the question is to do it in XSL, and
> if possible, what parser would accept this?
You can create Java classes with static methods to be called in your XSL
stylesheet.
This works well with XT (see http://www.jclark.com/xml/xt.html).
This is a small exemple of use:
In Java:
-------
package com.edf.util;
public class C1 {
public static String f1(String s) {
return s;
}
}
In XSL:
------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
xmlns:ext="http://www.jclark.com/xt/java/com.edf.util.C1"
>
...
<xsl:param:variable mame="var1">
...
</xsl:param-variable>
...
<xsl:if test="ext:f1(string($var1))=''">
...
</xsl:if>
...
Best regards.
Didier.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








