Hello Folks!
Using
http://support.microsoft.com/default...b;en-us;320847 as
a reference, I am trying to pipe the results of an XSL Transformation
directly out of a WebApp Default.aspx. The code is as follows;
------------------------------------------
Private Sub Page_Load(...) Handles MyBase.Load
'Put user code to initialize the page here
Dim xslDoc As New XslTransform
Dim xmlDoc As New XPathDocument(Me.Page.MapPath("cdcatalog.xml"))
Dim xmlRes As XmlResolver
xslDoc.Load(Me.Page.MapPath("cdcatalog.xsl"))
xslDoc.Transform(xmlDoc, Nothing, Response.OutputStream, xmlRes)
End Sub
------------------------------------------
This works with the exception of additional html at the end of the page
as noticed by "View Source". The shortened output is as follows
------------------------------------------
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Title</th>
<th align="left">Artist</th>
</tr>
<tr>
<td>Empire Burlesque</td>
<td>Bob Dylan</td>
</tr>
*************************************
*** This is all expecte output ***
*************************************
<tr>
<td>Unchain my heart</td>
<td>Joe Cocker</td>
</tr>
</table>
</body>
</html>
*************************************
*** The unexpected output follows ***
*************************************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>xml2html</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form name="Form1" method="post" action="xml2html.aspx" id="Form1">
<input type="hidden" name="__VIEWSTATE"
value="dDwtNjU0MzcyMTk1Ozs+xZpchddE2teruVaYH4Bmcjb Ihbs=" />
</form>
</body>
</HTML>
------------------------------------------
I have tried Stream.Position, Stream.Flush and Stream.EndWrite but with
no success.
***** Question: Is there a way to omit the extra HTML?
--
Best Regards
Todd