This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Embedding java-command in XSL-stylesheet???


first you've got to declare a namespace:
xmlns:myns="http://www.jclark.com/xt/java/com.mycompany.Myclass"

the first part: http://www.jclark.com/xt/java is predefined by xt
in the second part you've got to type your full classname


to call your method type for example:

<xsl:value-of select="myns:mymethod()"/>

it's even possible to pass parameters, and many much more...

Other xslt-processor (saxon, xalan, ora,...) have similar mechanisms, they
use other namespace-uris, other syntax,...
See at the specific Web-Sites, they have all examples...

michael


David Hemmingsson wrote:

> If I Use XT or some other Java-based XSLT-parser, is it then possible to
> embed calls to java methods in other classes?
> Like:
> <xsl:template match="data">
>         <a_tag>
>                 (something like) com.bla.data.getMyData();
>         </a_tag>
> </xsl:template>
>
> ...to get:
> <a_tag> The Data </a_tag>
>
> If it works I’ll be the happiest programmer of the day!
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> David Hemmingsson
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]