create XML file with ASP

S

shank

I have a stored procedure that creates XML content the way I want it using
FOR XML AUTO, ELEMENTS. At least when I run the query anyway. What I want is
to use that SP in an ASP page. When opened, I want a dialog box to pop up
with the option to open or save as... to the client's HDD. Here's my header
for the page. The recordset is below that. When I open the page, I get the
Save As.. I want, but no records are saved.

What I'm missing is how to deal with XML and the recordset thereof. It's
more of a feed that a recordset. How do I get that feed into a file on the
client machine?

<% Response.contenttype = "application/vnd.xml" %>
<% Response.AddHeader "Content-Disposition", "filename=Product.xml" %>

thanks
 
A

Adrienne Boswell

I have a stored procedure that creates XML content the way I want it
using FOR XML AUTO, ELEMENTS. At least when I run the query anyway.
What I want is to use that SP in an ASP page. When opened, I want a
dialog box to pop up with the option to open or save as... to the
client's HDD. Here's my header for the page. The recordset is below
that. When I open the page, I get the Save As.. I want, but no records
are saved.

What I'm missing is how to deal with XML and the recordset thereof.
It's more of a feed that a recordset. How do I get that feed into a
file on the client machine?

<% Response.contenttype = "application/vnd.xml" %>
<% Response.AddHeader "Content-Disposition", "filename=Product.xml" %>

thanks

You are probably using the wrong headers. You should be sending content
type text/xml .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top