passing the return value of javascript function to xsl variable

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ms_chika

    #1

    passing the return value of javascript function to xsl variable

    Please help! I just want to know how can i pass the return value of a
    javascript function to a xsl variable.

    I have an xsl file and from that file i will call a javascript function
    then the result will be stored in to the <xsl:variable > how will i do
    that? Or is it really possible to do that or is there other way of doing
    it?
    Your help will be very much appreciated.



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • Martin Honnen

    #2
    Re: passing the return value of javascript function to xsl variable



    ms_chika wrote:
    [color=blue]
    > I just want to know how can i pass the return value of a
    > javascript function to a xsl variable.
    >
    > I have an xsl file and from that file i will call a javascript function
    > then the result will be stored in to the <xsl:variable > how will i do
    > that? Or is it really possible to do that or is there other way of doing
    > it?[/color]

    Do you use an XSLT processor that supports JavaScript extension
    functions? Some do, but a lot don't.
    For instance with MSXML you can use J(ava)Script e.g. to write extension
    functions. If you need help with that then tell us but you need to
    provide more details on which processor you are using.
    In the end your extension function will sit in some namespace which has
    a prefix assigned and you can then write an XPath expression
    prefix:extensio nFunctionName()
    whereever you use XPath expressions in XSLT, so to set the value of a
    variable
    <xsl:variable name="variableN ame"
    select="prefix: extensionFuncti onName()" />

    But usually there are better, more XSLT specific ways to solve a problem
    in XSLT without relying on processor specific mechanisms of extension
    functions.

    So you might want to ask in an XSLT group on how to solve what you want
    to solve without using extension functions.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    Working...