XHTML & application/xml?

Can I ask a simple (but maybe stupid) question. Why was the
application/xhtml+xml MIME type developed and why don't you just serve
it up as application/xml? It works in most browsers so is surely
better than text/html.

Advertisements

UKuser wrote:
> Can I ask a simple (but maybe stupid) question. Why was the
> application/xhtml+xml MIME type developed and why don't you just serve
> it up as application/xml? It works in most browsers so is surely
> better than text/html.

Advertisements

On Jan 23, 6:02 pm, Martin Honnen <> wrote:
> UKuser wrote:
> > Can I ask a simple (but maybe stupid) question. Why was the
> > application/xhtml+xml MIME type developed and why don't you just serve
> > it up as application/xml? It works in most browsers so is surely
> > better than text/html.
>
> You first question application/xhtml+xml compared to application/xml.
> Then you compare to text/html. I don't understand what you want to say.
> application/xhtml+xml is for XHTML 1.x documents, text/html for HTML
> documents and for XHTML 1.0 documents following thehttp://www.w3.org/TR/xhtml1/#guidelinesguidelines.
> Seehttp://www.w3.org/TR/xhtml-media-types/
>
> And IE 6/7 do not support rendering XHTML documents served as
> application/xml, they simply display the document tree.
>
> --
>
> Martin Honnen
> http://JavaScript.FAQTs.com/

UKuser wrote:
> What i mean is - if XHTML is XML why did they need a new media type?

Because you might want to build a special DOM for instance. If you serve
XHTML as application/xml to Mozilla then Mozilla builds a W3C Core DOM
only, if you serve as application/xhtml+xml then it builds a Core and
HTML DOM.
SVG is XML too nevertheless there is a MIME type for it: image/svg+xml.
And XSLT is XML too, nevertheless there is a MIME type for it:
application/xslt+xml

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!