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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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

   
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.