Results 1 to 4 of 4

Thread: Another ASP/XML ?

  1. #1

    Thread Starter
    Lively Member Nator's Avatar
    Join Date
    Nov 1999
    Location
    East Larryville, GA
    Posts
    80

    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.

  2. #2
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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.

  3. #3
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    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.

  4. #4
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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
  •  



Click Here to Expand Forum to Full Width