Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: After xslt transformation i want to save transformed xml file

From: ManishBafna@-----------.---------.---
To: 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/
> 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent