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

Posted on 2009-02-21
Medium Priority
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="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<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
  • 2

Author Comment

ID: 23701212
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

jumprooster earned 0 total points
ID: 23701226
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

750 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