output as XML

P

Peter Morris

I have an ASP program. It outputs HTML with some
XML data islands in it. When I run the program, the
browser sees the HTML and doesn't work the way
I want it to. however, if I view source on the output
page, save the source as an XML file, then open the
saved file, it works properly.

How do I get the browser to treat the output from an
ASP program as XML instead of HTML?
 
M

Manohar Kamath

You need to change the MIME type the browser sees. By default, it sees
"text/html" and treats it as it would any HTML page. Add the following code
to the very top of your ASP page

<%
Response.ContentType = "text/xml"
%>
 
B

Bob Barrows [MVP]

Peter said:
I have an ASP program. It outputs HTML with some
XML data islands in it. When I run the program, the
browser sees the HTML and doesn't work the way
I want it to. however, if I view source on the output
page, save the source as an XML file, then open the
saved file, it works properly.

How do I get the browser to treat the output from an
ASP program as XML instead of HTML?

This is a client-side issue, so one of the scripting groups, or one of the
groups with "dhtml" in their names would be more appropriate.

A data island is identified by using an XML tag:

HTML stuff, then:
<XML id=myDataIsland>
xml stuff
</XML>

For more information, go to msdn.microsoft.com/library and search for "data
island"

Bob Barrows
 
B

Bob Barrows [MVP]

Minor clarification:
Bob said:
A data island is identified by using an XML tag:

<HTML>
HTML stuff, then:
<XML id=myDataIsland>
xml stuff
</XML>
</HTML>
 

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,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top