Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 12th, 2008, 04:11 AM
Registered User
Join Date: Dec 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Transform XML with transformNode in javascript

In the following situation where I have a XML which needs to transformed with a XSL file using the transformNode method I get an error. I have catched the err.number which is -2147467259
The XSL file uses an import in which I have created a xsl:variable. When using this variable in the main XSL I get the error.
I load the XML and XSL with Javascript using Microsoft.XMLHTTP
When both files are loaded I do the transformation with xmlDoc.transformNode(xslDoc);

What's the reason of this error and how can I fix it. The XSL as a stylesheet in the XML works fine when I open the XML in the webbrowser.

Here is the XSL which I used to test this.
1	<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 
2	  <xsl:import href="global.xsl"/> 
3	  <xsl:variable name="langfile" select="concat('/int/', $language, '/menu.xml')"/> 
5	  <xsl:template match="/content/menu"> 
6	    <h1>Menu</h1> 
7	  </xsl:template> 
8	</xsl:stylesheet>
The error is triggered by line 3. When removing this line the transformation is successfull

The global.xsl file
1	<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 
2	  <xsl:variable name="language" select="document('/configuration.xml')/configuration/language"/> 
3	</xsl:stylesheet>
Additional information:
For parsing I use the XML DOM Document from Microsoft.
The browsers which I'm using are IE6 and IE7

Does anyone have an idea?
Old December 12th, 2008, 05:08 AM
Friend of Wrox
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts

Post the actual error message and the xml input files. Check for the given file path in document() function.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Transform xml to xml changing one tag. surfer97301 XSLT 2 April 21st, 2010 05:14 PM
Transform XML with XSLT in JavaScript Mozilla Spankmaster79 Javascript 3 January 18th, 2006 07:31 AM
transformNode w/2 source XML docs? kwilliams XSLT 0 July 25th, 2005 03:38 PM
XSLT read through XML to transform another XML dendenx2 XSLT 8 July 7th, 2005 08:18 PM
Transform XML to XML using XSLT Mr.D XSLT 2 September 7th, 2004 02:13 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.