Wrox Programmer Forums
|
BOOK: Beginning JavaScript and CSS Development with jQuery
This is the forum to discuss the Wrox book Beginning JavaScript and CSS Development with jQuery by Richard York; ISBN: 9780470227794
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript and CSS Development with jQuery 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 September 1st, 2011, 05:06 PM
Registered User
 
Join Date: Sep 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Isn't the xml in xhtml+xml redundant?

I was surprised to see a new mime type in this book: xhtml+xml; Up till now I've only used XHTML 1.0. But it got me thinking: Isn't the xml redundant? I'm under the impression that the X in XHTML stands for XML. So it looks like this to me: x(ml)html+xml.
 
Old September 1st, 2011, 06:07 PM
Registered User
 
Join Date: Sep 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well,

Technically, no.

Actually, the 'X' in XHTML stands for eXtensible.

Now, the fact that you are extending HTML with a subset of XML, and then adding full XML does seem rather redundant, however as you can see from the Wikipedia entry on XHTML, the two are not congruous, so there is not as much overlap as it might appear at first glance.
Quote:
Originally Posted by The Wikipedia entry on XHTML
...
Root element

The root element of an XHTML document must be html, and must contain an xmlns attribute to associate it with the XHTML namespace. The namespace URI for XHTML is http://www.w3.org/1999/xhtml. The example tag below additionally features an xml:lang attribute to identify the document with a natural language:
Code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
DOCTYPEs

In order to validate an XHTML document, a Document Type Declaration, or DOCTYPE, may be used. A DOCTYPE declares to the browser the Document Type Definition (DTD) to which the document conforms. A Document Type Declaration should be placed before the root element.
The system identifier part of the DOCTYPE, which in these examples is the URL that begins with http://, need only point to a copy of the DTD to use, if the validator cannot locate one based on the public identifier (the other quoted string). It does not need to be the specific URL that is in these examples; in fact, authors are encouraged to use local copies of the DTD files when possible. The public identifier, however, must be character-for-character the same as in the examples.

XML declaration

A character encoding may be specified at the beginning of an XHTML document in the XML declaration when the document is served using the application/xhtml+xml MIME type. (If an XML document lacks encoding specification, an XML parser assumes that the encoding is UTF-8 or UTF-16, unless the encoding has already been determined by a higher protocol.)
For example:
Code:
<?xml version="1.0" encoding="UTF-8" ?>
The declaration may be optionally omitted because it declares as its encoding the default encoding. However, if the document instead makes use of XML 1.1 or another character encoding, a declaration is necessary. Internet Explorer prior to version 7 enters quirks mode, if it encounters an XML declaration in a document served as text/html.
HTH.
 
Old September 1st, 2011, 07:22 PM
Registered User
 
Join Date: Sep 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Now that you mention it, I do remember my XHTML book saying that the X was from eXtensible (especially when you write it that way). Makes much more sense now.

I had done a quick Google search (without luck) for '"xhtml+xml" mime redundant' to see if anyone else had asked the same question. But I didn't think to search Wikipedia for XHTML.

Thank you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
redundant text in output xml metinhoclam XSLT 3 August 13th, 2010 06:55 AM
Split xml file with result document and javax.xml.transform.Transformer. nisargmca XSLT 3 January 12th, 2010 06:26 AM
xml invalid top level from ASP write XML(solution) g000we XML 0 August 9th, 2006 03:56 AM
Forms with XML > XSLT > XHTML kwilliams XSLT 0 October 27th, 2005 09:52 AM
xhtml-tags i xml value-of select patric_jansson XSLT 5 October 3rd, 2005 12:15 PM





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