|
-
Jun 21st, 2001, 11:01 AM
#1
Thread Starter
Lively Member
Another ASP/XML ?
I was trying to see what happened if an ASP were to write an XML document.
<% @ Language=VBScript%>
<%
str1 = "XML test"
%>
<? xml version="1.0" ?>
<MESSAGE>
<TEST><%=str1%></TEST>
</MESSAGE>
All this does is display XML Test as if it were formatted in HTML. By default, I'm assuming ASP serves up everything as HTML. Is there a way to tell the document to serve up something else? I am being forced to test this on a W98 PWS machine so if it is a MIME type issue, I may be out of luck.
-
Jun 21st, 2001, 11:09 AM
#2
Frenzied Member
Oh, you don't want ASP to 'write' the document. It will create it the same way it creates a file with FSO.
http://xml101.com/articles/michael/a...ml/default.asp
Take a look at the ASP in this article. See how he creates the XMLDOM object and creates the keys within it?
ASP will keep the XML doc on the server side. It can do all of this XML shuffling without the client machine seeing it.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Jun 21st, 2001, 01:23 PM
#3
Black Cat
By default, I'm assuming ASP serves up everything as HTML. Is there a way to tell the document to serve up something else?
Yes, the default is HTML. Use Response.ContentType = "text/xml" or whatever to change that. (Make sure you set that before anything is sent to the client or you'll raise an error).
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Jun 21st, 2001, 02:32 PM
#4
Frenzied Member
Wow... cool trick. I'm not sure where I can use that, but I did not know that.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|