Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > output as XML

Reply
Thread Tools

output as XML

 
 
Peter Morris
Guest
Posts: n/a
 
      10-12-2004

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?


 
Reply With Quote
 
 
 
 
Manohar Kamath
Guest
Posts: n/a
 
      10-12-2004
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"
%>

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com


"Peter Morris" <nospam.ple@se> wrote in message
news:VgFad.6955$(E-Mail Removed) ...
>
> 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?
>
>



 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-12-2004
Peter Morris wrote:
> 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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-12-2004
Minor clarification:
Bob Barrows [MVP] wrote:
> A data island is identified by using an XML tag:
>


<HTML>
HTML stuff, then:
<XML id=myDataIsland>
xml stuff
</XML>
</HTML>
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort xml and output xml Jim Andersen XML 10 12-08-2006 10:40 AM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Altova Mapforce - xml 2 xml map: empty elements output although input element is not empty Lukas XML 3 11-10-2005 02:25 PM
Multiple Input XML documents to produce one output XML SV XML 1 08-16-2005 10:37 AM
asp:Xml control and Xml output Grant Harmeyer ASP .Net 1 02-03-2004 03:25 PM



Advertisments