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

Re: accessing Java method from xslt

Subject: Re: accessing Java method from xslt
From: Mike Brown <mike@xxxxxxxx>
Date: Fri, 13 Sep 2002 15:26:03 -0600 (MDT)
java methods in xslt
Holmberg Rick-ra0119 wrote:
> <myxml>
> <RelatedId>Test11-Diagram</RelatedId>
> </myxml>
> 
> 
> Here is a snippit of my xslt file...
> 
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>        xmlns:CollateralXML="class:../classes/xml/CollateralXML">
> 
> <xsl:template match="myxml">
> <xsl:output method="html"/>
> <xsl:apply-templates select="RelatedId" />
> </xsl:template>
> 
> <xsl:template match="RelatedId">
> 	<B>Categories:</B><br/>
> 		<xsl:value-of select="CollateralXML:getUrl(.\),
> 		<br/>
> </xsl:template>
> 
> 
> I am not sure what to put in the getUrl.  I need the value of Test11-Diagram to be sent to the method in CollateralXML called getUrl. The method getUrl is static.

No idea if the API you are using is what your XSLT processor expects (the
binding of extension functions to Java methods varies from processor to
processor), but getUrl(string()) is what you want.

string() = string(.) = string-value of context node

The context node is the RelatedId element being processed by that template;  
and the string-value of an element is the concatenation of the text in all its
descendant text nodes.

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

 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.