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 9:50:00 PM Thanks Martin for replying.It is working but we are now facing another
problem.we have to include external js file using
<script type="text/javascript" src="myFile.js"/>.
In that case it fails.what changes need to be done in order to include
external js using ur code.Is there any way we can avoid
xmlns:mf="http://example.com/2009/mf1"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
as we will need to prefix all the function calls with mf.which may create
problem.Thanks in advance for replying[as always]
"Martin Honnen" wrote:
> 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 | |||
|
