Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - RE: After xslt transformation i want to save transformed xml file >Thread Next - Re: After xslt transformation i want to save transformed xml file Re: After xslt transformation i want to save transformed xml fileTo: NULL Date: 1/6/2009 1:11:00 PM Manish Bafna wrote:
> Also one more thing is that javascript custom/user functions have been used
> in xslt for transforming xml.One problem we were facing is that it didnt
> recognized javascript custom user function while we set otput type to text.It
> just displayed the name of javascript custom function instead of output of
> javascript custom function
Sorry, I can't reproduce that, the problem must be elsewhere. Please
provide a minimal but complete sample that allows us the reproduce the
problem.
Here is the sample I used:
XML document test2009010601.xml:
<foo xml:lang="de">äöüß</foo>
Stylesheet test2009010601Xsl.xml:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:mf="http://example.com/2009/mf1"
xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:output method="text"/>
<xsl:template match="foo">
<xsl:value-of select="mf:toUpper(string(.))"/>
</xsl:template>
<msxsl:script language="JavaScript" implements-prefix="mf">
function toUpper(str) {
return str.toUpperCase();
}
</msxsl:script>
</xsl:stylesheet>
JavaScript code:
var doc = new ActiveXObject('Msxml2.DOMDocument.3.0');
doc.async = false;
doc.load('test2009010601.xml');
var sheet = new ActiveXObject('Msxml2.DOMDocument.3.0');
sheet.async = false;
sheet.load('test2009010601Xsl.xml');
alert(doc.transformNode(sheet));
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
