473,566 Members | 3,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Should the webserver add "Content-Type: text/xml header" to the requested XML file?

I've been informed that a webserver sending a
XML file is supposed to add "Content-Type:
text/xml header".

I'm not questioning that infromation but i'm
unsure what was ment by it. The XML i get on
my screen when i type in the url to it looks
as follows.

<?xml version="1.0" encoding="UTF-8"?>
<tag-uno>uno</tag-uno>
<tag-duo>duo</tag-duo>

I can't see any line containing "text/xml"
but perhaps it's not supposed to show in the
requested file. Please advise.

--
Regards
Konrad Viltersten
--------------------------------
sleep - a substitute for coffee for the poor
ambition - lack of sense to be lazy

Jun 27 '08 #1
3 2393
* K Viltersten wrote in comp.lang.javas cript:
>I've been informed that a webserver sending a
XML file is supposed to add "Content-Type:
text/xml header".
This is a reference to information in the HTTP header. There are various
tools to inspect the HTTP header, for an example see The W3C web service
<http://cgi.w3.org/cgi-bin/headers?url=htt p://cgi.w3.org/cgi-bin/headers>.
This information isn't visible if you "View Source" in your web browser.
You have to configure your web server to generate this header, how to do
that depends on your server software and how you store the XML on it. It
would be better, to use "applicatio n/xml" instead of "text/xml" by the
way.
--
Björn Höhrmann · mailto:bj****@h oehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Jun 27 '08 #2
>>I've been informed that a webserver sending a
>>XML file is supposed to add "Content-Type:
text/xml header".

This is a reference to information in the HTTP
header. There are various tools to inspect the
HTTP header, for an example see The W3C web
service <http://cgi.w3.org/cgi-bin/headers?
url=http://cgi.w3.org/cgi-bin/headers>.
This information isn't visible if you "View
Source" in your web browser.
Thanks for the answer. I believe i'm starting
to grasp the cause of the issue now. Still,
there are two things i'm unclear about.
You have to configure your web server to
generate this header, how to do that depends
on your server software and how you store the
XML on it.
The server is something that MS VWD starts
automatically when i choose to view a HTML in
the browser. I really, really have no clue how
to configure it. Is it something specific to
MS SQL Server?
It would be better, to use "applicatio n/xml"
instead of "text/xml" by the way.
Why? (I'm not arguing against the statement.
Just want to understand.)

--
Regards
Konrad Viltersten
--------------------------------
sleep - a substitute for coffee for the poor
ambition - lack of sense to be lazy

Jun 27 '08 #3
Bjoern Hoehrmann wrote:
...
You have to configure your web server to generate this header, how to do
that depends on your server software and how you store the XML on it. It
would be better, to use "applicatio n/xml" instead of "text/xml" by the
way.
In the OP's case, 'text/xml' should be used when offering an XML-file
to the browser, regardless of how the XML-data itself was generated at
the server.

http://www.ietf.org/rfc/rfc3023.txt says:

| If an XML document -- that is, the unprocessed, source XML document
| -- is readable by casual users, text/xml is preferable to
| application/xml.

Nevertheless Apache seems to prefer 'application/xml' when nothing
else is specified.

--
Bart
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
20003
by: Todd Anderson | last post by:
I'm ussing this <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> to keep me html page from caching. But it's not working. Is there a javascript that will do this? Thanks in advance for your help.
10
3383
by: Blue® | last post by:
I would like to call the content of content.htm (containing only HTML codes) into index.htm. This is usually done by renaming index.htm to index.shtml and use this tag: <!--#include file="content.htm" --> But I do not want to use SSI. Is it possible to call it using something like:
10
26183
by: Richard R Plourde | last post by:
Well, the error message... "Please, validate your XML document first! Line 1 Column 1 Content is not allowed in prolog." comes up when I try to verify my CSS...
10
7128
by: Michael Strorm | last post by:
Hi! I've been having problems with a DTD. Having had the Sun XML validator reject a document, I put it through 'xmllint' for more information. 'Xmllint' noted a problem with the DTD itself; "validity error : Content model of section is not determinist: (text , (list , text)* , list?)" Here's a very simplified version of the DTD...
12
2852
by: Jean-Marc Blaise | last post by:
Hi Folks, I'm getting this message with the XML tutorial: getstart_exportXML.cmd file: SQL0444N Routine "DB2XML.CONTENT" (specific name "DB2XMLCONTENTVF") is implemented with code in library or path "\db2xmlfn", function "dxxContent_varchar2file" which cannot be accessed. Reason code: "4". SQLSTATE=42724 DB20000I The TERMINATE command...
0
1342
by: Patrick | last post by:
hi several general webpages (more or less static, e.g. errorpage, timeoutpage etc.) i need in all kind of asp.net-applications. instead of copy this pages (the *.aspx or *.html) into every project explicit, i'd like to consolidate them into a single dll, which i can reference and use in every asp.net-application. - that's the idea....
0
1628
by: J.Edwards | last post by:
I'm getting this error when trying to use a control built in VS 2003 (1.1) in a new asp project in VS 2005. "Content controls can only be used in a content page" The control has always worked ok in 2003, and I've not seen this error before so does anyone know what it could be? Can't find anything on the web about it.
2
6110
by: dclist | last post by:
What is the correct way to download a file through HTTP and save it to the file name suggested by "Content-Disposition"? I would use urlretrieve but I'm not sure how to obtain the file name through the HTTP headers without downloading the body (e.g. urlopen(url).info()).
0
1549
by: Kevin Frey | last post by:
We have a data-centric application where all of the "layout" for each data centric page is to be codified (ie. it is expressed in C# code rather than being expressed declaratively). This codification subsequently produces the required web-controls for a page based on whether the page is eg. in view or update mode, examination of the user's...
3
7044
by: Alexander Smirnov | last post by:
I'm developing asp.net 2 web application and need to make a custom http handler which sometime must send response with "204 No Content" code. I set HttpResponse.Status="204 No Content"; But asp automatically adds headers such as "Content-Length: 0". This causes an error on the client. HttpResponse.ClearHeaders() doesn't help. How to make asp...
0
7673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8109
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6263
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5485
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2085
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.