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

how to pass arguments to xt extension functions ?

Subject: how to pass arguments to xt extension functions ?
From: "Smith BC (Brian) at MSXSSC" <BS185791@xxxxxxxxxxxxxxxx>
Date: Fri, 21 May 1999 15:06:13 -0500
sqlxml xsl


I am trying to figure out how to pass string arguments to 
xt extension functions.  I can not get the following to work:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
           xmlns:w="http://www.jclark.com/xt/java/sqlxml" >
<xsl:template match="cis">
   <xsl:variable name="this" expr="w:new()" />
   <xsl:variable name="usr"  expr="@name" /> 
   <xsl:value-of select="$usr" />                                    <!--
this returns the correct value -->
   <xsl:value-of select="w:con1($this, string($usr) )" />   <!-- this yields
an illegal arguments error -->
</xsl:template>
</xsl:stylesheet>	

where the xml is:
<cis name="sa">
  <database>jdbc:odbc:cis </database>
</cis>

and where con1 is declared as:
	public String con1 (String user)

I must be missing something obvious here.  Below
are two working examples that correctly handle
this arguments and strings.  I just can't the combined
example to work....

I have tried numerious variations, but suggestions would
be welcomed!  Or if anyone has got this working I would
love to get a definitive answer.  Thanks to all!



------------------these samples work -------------------
------------------together they show how to 
------------------use this pointers and how to
------------------use string arguments.....

Here is short demo that works:
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0" 
 
xmlns:w="http://www.jclark.com/xt/java/com.jclark.xsl.sax.TextFileWriter">

   <xsl:template match="file">
       <xsl:variable name="file" expr="@name"/>
      <xsl:variable name="contents"><xsl:apply-templates/></xsl:variable>
       <!-- -->
       <xsl:value-of select="w:write($contents, string($file) )"   />
   </xsl:template>

</xsl:stylesheet>

where write is declared as :
    static public void write(ResultTreeFragment frag, String file)

--------------------------------
--------------------------------

this also works:
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
           xmlns:w="http://www.jclark.com/xt/java/sqlxml" >

    <xsl:template match="cis">
         <xsl:variable name="this" expr="w:new()" />
         <xsl:variable name="usr"> <xsl:value-of select="user" />
</xsl:variable>
         <xsl:value-of select="w:con($this )" /> 
    </xsl:template>

    </xsl:stylesheet>

where con is declared
     public String con ()


Brian Smith


 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.