Subject: Calling java method From: "Dave Pawson" <dave.pawson@xxxxxxxxxx> Date: Thu, 29 Apr 1999 13:03:33 +0100 |
I was trying to get the contents of a source document element through to java, then back again, modified (eventually to apply braille contractions.) and added to the output content. My need was to obtain the content of the element, hence I'm using the parameter variable for this. I also got hold of an attribute value from the source document. HTH, Regards, DaveP <!DOCTYPE xsl:stylesheet <!ENTITY nbsp " "> <!ENTITY sp "<xsl:text> </xsl:text>"> <!ENTITY common-colour "#003300"> ]> <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0" xmlns="http://www.w3.org/TR/REC-html40" xmlns:myjava="http://www.jclark.com/xt/java/TestMyJava" result-ns="" indent-result="yes" default-space="preserve"> <xsl:template name="contract"> <xsl:param-variable name="p1"> No Content </xsl:param-variable> <xsl:value-of select="myjava:callme3( ( string($p1) ) )"/> </xsl:template> <!-- Note the spacing in the parameters. See Working Draft, 6.2.7 [34] --> <xsl:template match="para|simpara"> <P> <xsl:call-template name="contract"> <xsl:param name="p1"> <xsl:value-of select="." /> </xsl:param> </xsl:call-template> </P> </xsl:template> public static String callme3(String text) { return "*** " + text + " ***"; } Output is <p>*** Content of para|simpara***</p> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Fw: XSL macros stronger then XS, David Carlisle | Thread | RE: Calling java method, Ed Simon |
XSL macros stronger then XSLT, Oren Ben-Kiki | Date | namespaces (again), David Carlisle |
Month |