classic asp using xml and xslt transform response sending resulting html without xml values

Posted on 2009-02-21
Last Modified: 2013-11-18
I have an asp page that when first loaded writes HTML to the client browser.

The resulting HTML is generated with the ASP code using a XML-XSLT transformation.

The problem is that only the HTML portion of the XSLT document is returned. The XSLT code that is supposed to generate values from the XML file do not return from the server-side execution of the ASP page.

Can anyone see why?

this is the ASP page (.asp)




	'The "loadXMLFile" Function accepts two parameters.

	'strXMLFile - The path and file name of the XML file.

	'strXSLFilee - The path and file name of the XSL file.




fileHTMLCreated=loadXMLFile(strXMLFile, strXSLFile)	


	Function loadXMLFile(strXMLFile, strXSLFile)


	 'Declare local variables

	 Dim objXML

	 Dim objXSL



	 'Instantiate the XMLDOM Object that will hold the XML file.

	 'set objXML = Server.CreateObject("Microsoft.XMLDOM")

	  set objXML = Server.CreateObject("Msxml2.DOMDocument.4.0")

	 'Turn off asyncronous file loading.

	 objXML.async = false


	 'Load the XML file.




	 'Instantiate the XMLDOM Object that will hold the XSL file.

	 'set objXSL = Server.CreateObject("Microsoft.XMLDOM")

	 set objXSL =Server.CreateObject("Msxml2.DOMDocument.4.0")

	 'Turn off asyncronous file loading.

	 objXSL.async = false


	 'Load the XSL file.






	 'Use the "transformNode" method of the XMLDOM to apply the

	 'XSL stylesheet to the XML document. Then the output is

	 'written to the client.


	  set objXML = nothing

	set objXSL = nothing


	End Function



this is the xml file: (products_tester.xml)

<?xml version="1.0"?>








this is the xslt file (products_tester.xsl)

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet xmlns:xsl="" version="1.0">

  <xsl:template match="/">


<html xmlns="">


<title>DEXTEL.NET Excercise</title>

<link rel="stylesheet" type="text/css" href="write_xml3.css" />

<script type="text/javascript" src="write_xml3.js"></script>




<table width="100%" border="0" style="position:absolute;top:20%;">


  	<td width="33%">



    <td width="33%">

    	<form method="post" name="form" action="">

        <table width="100%" border="0" >


    			<td colspan="2" align="left"><strong>Enter new product:</strong></td>




    			<td><input name="txtName" type="text" /></td>




    			<td><input name="txtPrice" type="text" /></td>



    			<td>Image URL:</td>

    			<td><input name="txtImageURL" type="text" /></td>




    			<td><input type="button" value="Submit" onclick="showProducts(this.value)"/></td>





    <td width="33%">





<ul id="slideshow"> 

 <xsl:for-each select="/PRODUCTS/PRODUCT">



    <xsl:attribute name="src">

    	<xsl:value-of select="IMAGEURL"/>



    </img><br />


        <p align="center"><xsl:value-of select="NAME"/><br />


        <p align="center"><xsl:value-of select="PRICE"/></p>







<script type="text/javascript">








Open in new window

Question by:jumprooster

    Author Comment

    i have tested this by just looking at the xml (linked to the xslt file with a stylesheet relationship) in the browser so it seems that the problem is with the asp code


    Accepted Solution

    found the problem, always happens right after I ask someone a question

    the variable strXMLFileName for the XML file not the same name as the one passed to the function that loads the xml file and the xsl file

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now