Wrox Programmer Forums
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 1st, 2009, 11: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.
Old November 2nd, 2009, 07:13 AM
Friend of Wrox
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 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:
<%@ 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
Old November 2nd, 2009, 12:46 PM
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.


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 11:45 AM
firefox / IE flipo Beginning PHP 7 November 8th, 2005 12:38 PM
firefox Vs IE fred_brie HTML Code Clinic 1 February 22nd, 2005 04:12 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.