473,327 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Extra HTML In Response.OutputStream from ASP.Net xslDoc.Transform


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
Nov 12 '05 #1
2 4211
Hello Todd,

This extra HTML is coming from the .aspx file hosting your webform. In your
case this file is only a placeholder, something with the appropriate
extension to drive the request to your class. Just remove the HTML code from
your .aspx file.

Be sure to leave the <%Page directive, otherwise your page won't be
associated with your .vb code-behind file and your form class.

Cheers,
Samu
Nov 12 '05 #2

Thank you So Much!

That works just great. I was thinking that the <form> tag was a
required part of Web Apps but that must only be for the traditional posting
of data. Anyway, thank you again and have a wonderful day.

Sincerely
Todd

"Samu Lang" <z> wrote in message
news:u$**************@TK2MSFTNGP14.phx.gbl...
Hello Todd,

This extra HTML is coming from the .aspx file hosting your webform. In
your case this file is only a placeholder, something with the appropriate
extension to drive the request to your class. Just remove the HTML code
from your .aspx file.

Be sure to leave the <%Page directive, otherwise your page won't be
associated with your .vb code-behind file and your form class.

Cheers,
Samu

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeff Gutsell | last post by:
I'm trying to develop a system for transforming an xml file into two different html pages via VBscript. My code fails but does not generate any error messages. Here's my VBscript: Set xmlDoc =...
1
by: Neil Woodvine | last post by:
***Scenario ... I have a DataList with a hyperlink WebControl in the Item Template. I want to display a 64x64 image in the Hyperlink and set the NavigateURL to the full size image. ***Source...
5
by: KathyB | last post by:
If someone could just explain this to me...I just don't get it! I have an aspx page where I retrieve several session variables and use xmlDocument to transform xml file with xsl file into an...
2
by: KathyB | last post by:
Hi, I have a transformed xml source into html for client input. In order to update the xmlDoc on the server, how do I specify the correct nodes if they are built dynamically through assigning id's...
3
by: Sergio Otoya | last post by:
Hi all, I need to transform an xml document, using xsl to a HTML output. I can do this successfully using the XslTransform class as below: Dim oTrans As New XslTransform ...
1
by: Tim Menninger | last post by:
When I use the XslTransform.Transform method to write to the HttpRequest.OutputStream The first byte of the output is always an invalid character, looks like an ascii zero or some other...
1
by: Tom Vergote | last post by:
Hello world, I'm running into an issue where I would like to save the response stream as an html file on the server (and convert it to a pdf) I've tried putting a streamreader on the...
1
by: Andrew | last post by:
I'm adding this as it to me a while to figure out all the pieces to be able to do this without using Microsoft.Office.Interop which caused me problems on the web-server. Streaming is the easy...
2
by: Ken Cox - Microsoft MVP | last post by:
I'm trying to find a way to program in ASP.NET 2.0 but capture the HTML output. I found the following routine in ASP.NET 2.0 Cookbook from O'Reilly. It doesn't work if I include a server-side...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.