savruk
savruk

Reputation: 545

How to call javascript functions from XSLT without using additional libraries etc.?

I must have a return value from javascript function. Is there a way to do this without using additional libraries. What I tried:

<xsl:variable name="fieldOf">
    <xsl:value-of select="name()"/>
</xsl:variable>
<xsl:variable name="type">
    <xsl:value-of>
        <script type="text/javascript">
            getTypeFromXSDFile(<xsl:value-of select="$fieldOf"/>)        
        </script>
    </xsl:value-of>
</xsl:variable>

So that I can use return value of javascript function.

Thanks

Upvotes: 0

Views: 7047

Answers (2)

Dimitre Novatchev
Dimitre Novatchev

Reputation: 243549

No, Not in pure XSLT.

Some XSLT processors provide their own way to call Javascript (or other language) functions. For example, all Microsoft XSLT processors provide the <msxsl:script> element.

Upvotes: 2

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799230

No. You can only use XPath functions.

Upvotes: 0

Related Questions