XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Brian JeffersonSubject: XSLT: How to get the value returned from javascript function.
Author: Brian Jefferson
Date: 14 Apr 2005 04:18 AM
I have writen a small program to call javascript function to return me a formated string. Later I print the string
in XSLT file. However, it's failed. Then I try to use the "Document.writeln" instead of "return string" in javascript.
IT WORK! Can anyone please explain to me???


<?xml version='1.0' encoding='utf-8'?>
<!--xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt">

<xsl:output method="html" />

<xsl:template match="/">
<script language="JavaScript">
<![CDATA[

function DivideString()
{
var where_is_mytool="home//mytool///mytool.cgi////abcdefg";
var mytool_array=where_is_mytool.split("/");
var str=mytool_array.join("\r\n");
//document.writeln(str);
return str;
}
]]>

</script>

<html>
<body>
<xsl:text>Values: </xsl:text>
<script>DivideString();</script>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Postnext
Ivan PedruzziSubject: XSLT: How to get the value returned from javascript function.
Author: Ivan Pedruzzi
Date: 16 Apr 2005 09:34 PM
Hi Brian

document.writeln is executed when IE renders the transformation result.

If you are trying to call a script extension in your XSLT you need to do like below.

Hope this helps
Ivan
Stylus Studio Team


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="my-utility-function">
<xsl:output method="html"/>
<msxsl:script language="JScript" implements-prefix="user"><![CDATA[
function DivideString()
{
var where_is_mytool="home//mytool///mytool.cgi////abcdefg";
var mytool_array=where_is_mytool.split("/");
var str=mytool_array.join("\r\n");
return str;
}
]]>
</msxsl:script>
<xsl:template match="/">
<html>
<body>
<xsl:value-of select="concat('Values ', user:DivideString())"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Posttop
sherlyn johnSubject: XSLT: How to get the value returned from javascript function.
Author: sherlyn john
Date: 10 Mar 2010 02:44 AM
Hi,
I am calling javascript in XSLT using extencsion function. This was working fine in WAS5 but is not working in WAS6.1.

In WAS5 we were using classloader 'PARENT_LAST' and in WAS6.1 we are using 'PARENT_FIRST'.

I know classloader is the problem but can not change it to 'parent_last' as application does not work at all with this classloader.

Please suggest an alternative way to call javascript.

Thanks

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.