Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP XML
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 1st, 2009, 10:00 PM
Registered User
 
Join Date: Nov 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
Reply With Quote
  #2 (permalink)  
Old November 2nd, 2009, 06:13 AM
Friend of Wrox
Points: 6,673, Level: 34
Points: 6,673, Level: 34 Points: 6,673, Level: 34 Points: 6,673, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2007
Location: Germany
Posts: 1,242
Thanks: 0
Thanked 244 Times in 243 Posts
Default

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, Data Platform Development) 2005/04 - 2013/03
My blog
Reply With Quote
  #3 (permalink)  
Old November 2nd, 2009, 11:46 AM
Registered User
 
Join Date: Nov 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange behavior of Firefox 3 and hallo.xml PKHG BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 3 August 6th, 2008 10:32 AM
XML with CSS: IE vs Firefox Jay Frank XML 5 October 29th, 2007 08:12 AM
how with firefox akkad Javascript How-To 4 December 28th, 2006 10:45 AM
firefox / IE flipo Beginning PHP 7 November 8th, 2005 11:38 AM
firefox Vs IE fred_brie HTML Code Clinic 1 February 22nd, 2005 03:12 PM



All times are GMT -4. The time now is 08:23 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.