|
|
 |
| Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP XML section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

November 1st, 2009, 11:00 PM
|
|
Registered User
|
|
Join Date: Nov 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ie recognizes this xml, but firefox doesn't
When I product the following xml using aspx (dot net) it works fine in both ie and firefox. When I produce the same xml using asp (classic), firefox just reads it as html, but ie seems to accept it as xml. I've heard of the whitespace issues before the opening <?xml tag, is there something else I'm missing.
Can someone provide a very simple asp (classic) based page that produces acceptable xml for firefox? Please? Thanks in advance. I much appreciate your help.
This is my extremely simple bit of xml. Firefox is strict, which is good, but I can't figure out what I'm doing wrong. Is it the encoding?
I don't believe there's any white space, does asp classic throw some invisible white space in there or what? frustrating.
<?xml version="1.0" encoding="UTF-8"?><rows><rec>lkj</rec></rows>
Seems pretty simple, but I'm doing something wrong.
|

November 2nd, 2009, 07:13 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2007
Location: Germany
Posts: 655
Thanks: 0
Thanked 98 Times in 97 Posts
|
|
Well it does not matter whether it is ASP.NET or classic ASP that dynamically creates the XML document, what matters is that you set the Content-Type to application/xml so that the browser knows to parse and treat it as XML:
Code:
<%@ Language="VBScript" CodePage="65001"%>
<%
Dim doc
Set doc = CreateObject("Msxml2.DOMDocument.3.0")
doc.appendChild doc.createElement("root")
Dim foo
Set foo = doc.createElement("foo")
foo.text = "a < b"
doc.documentElement.appendChild foo
Response.ContentType = "application/xml"
doc.Save Response
%>
__________________
Martin Honnen
Microsoft MVP - XML
My blog
|

November 2nd, 2009, 12:46 PM
|
|
Registered User
|
|
Join Date: Nov 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks
Hi Martin,
Thanks for your help. I just needed the:
Response.ContentType = "application/xml"
I should have realized this as this is the way I have it in asp.net. Thanks for your help. I really really appreciate it.
acantorcpa@hotmail.com
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |