p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP XML
I forgot my password Register Now
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 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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 1st, 2009, 11:00 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old November 2nd, 2009, 07:13 AM
Friend of Wrox
Points: 3,131, Level: 23
Points: 3,131, Level: 23 Points: 3,131, Level: 23 Points: 3,131, Level: 23
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Nov 2007
Location: Germany
Posts: 655
Thanks: 0
Thanked 98 Times in 97 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
My blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old November 2nd, 2009, 12:46 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 11:32 AM
XML with CSS: IE vs Firefox Jay Frank XML 5 October 29th, 2007 09: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



All times are GMT -4. The time now is 04:33 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc