473,396 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Google Chrome Comments Out XML Declaration

Hi,

If I use php to echo an XML file directly to the response, all I see is the XML text.

This is because Google Chrome comments out the XML declaration at the start of the text, causing it to treat the rest of the XML as an HTML document.

If I view source, copy and paste the XML exactly as it is into an actual XML file, place this file in the exact same directory on my web site as the php file, and try to load the XML file, it works correctly.

Is there some trick to the response I need to do in order to emulate an XML download? (e.g. headers)

Regards,
Rob.
Oct 9 '11 #1

✓ answered by drhowarddrfine

If you are saving a file with an xml extension, your server is most likely recognizing that and automatically serving it as application/xml. If you just echo the xml, it's treated as text only.

2 2812
drhowarddrfine
7,435 Expert 4TB
If you are saving a file with an xml extension, your server is most likely recognizing that and automatically serving it as application/xml. If you just echo the xml, it's treated as text only.
Oct 9 '11 #2
Yup,

Added a call to header("Content-type: application/xml");
prior to calling the echo.

That fixed it.

Cheers,
Rob
Oct 16 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Guy Macon | last post by:
Serious Security Flaw in Google Chrome: http://www.readwriteweb.com/archives/security_flaw_in_google_chrome.php -- Guy Macon <http://www.GuyMacon.com/>
0
by: wpjoju | last post by:
i have this code which adds an event listener to a newly opened window but it doesn't seem to work in google chrome. the problem is window.addEventListener seem to work in chrome but if you do...
0
by: catoblepa80 | last post by:
How can i read all google chrome bookmarks and place it into a list or a dictionary? i think the best way is to use regular expressions on the chrome bookmarks file, can you help me to accomplish...
2
KeredDrahcir
by: KeredDrahcir | last post by:
When using an object tag to embed a video file everything looks fine in Internet Explorer and Safari. However I can't get it to display at all in Opera. More importantly in Firefox and Google Chrome...
5
by: su817200 | last post by:
Dear Friend, Could you please let me know, how to enable ActiveX controls in Google Chrome Internet Browser. Is there any patch we need to install. Please let me know. Rgds,
3
KeredDrahcir
by: KeredDrahcir | last post by:
Can anyone help me. I don't know if this is a mysql, php or Google Chrome error. I have a login form but for some reason I'm getting an error when I use Google Chrome. It used to work in all...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.