473,785 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validing XHTML vs Html

Hello,

If my html is valid XHTML accroding to http://validator.w3.org/, does
thuis mean it is also valid (4.0.1) Html?

Thanks in Advance

Mar 2 '06
13 1859
"Jukka K. Korpela" <jk******@cs.tu t.fi> writes:
An XML declaration (<?xml ...>) at the start of document, as allowed
in XHTML, makes a document nonconforming (though not invalid) by HTML
4.01 rules.


The general policy of W3C HTML – as far as I know it – is a vague “‘foo’
is recommended” rather than an explicit “‘bar’ is Verboten”. *If*
processing instructions in the prolog are nonconforming, HTML cannot be
processed by any conforming SGML system as a conforming application in
the first place. End of story (obfuscating nsgmls output with
undocumented heuristics, as the W3C validation service happens to do,
does not rewrite standards; no surprise, but that qualifies 'invalid' as
undefined).
--
||| hexadecimal EBB
o-o decimal 3771
--oOo--( )--oOo-- octal 7273
205 goodbye binary 111010111011
Mar 3 '06 #11
Peter Williams wrote:
Apart form some trivialities (eg swapping DOCTYPE) correct XHTML is a
superset of correct HTML ?


Not really.

Apart from swapping the DOCTYPE, it is possible to create a document that
is both valid HTML *and* valid XHTML. For example, given the right
DOCTYPE, the following markup is valid HTML 4.01 and XHTML 1.0:
[listing 1]
<html lang="en">
<head>
<title>Example. </title>
</head>
<body>
<h1>Example.</h1>
<p>This is an example.</p>
</body>
</html>

However, the following valid HTML document would not be valid as XHTML:
[listing 2]
<html lang="en">
<title>Example. </title>
<h1>Example.</h1>
<p>This is an example.
</html>

and the following XHTML would not be valid as HTML:
[listing 3]
<html xml:lang="en">
<head>
<title>Example. </title>
<meta name="title" content="Exampl e."></meta>
</head>
<body>
<h1>Example.</h1>
<p>This is an example.</p>
</body>
</html>

So, if we're going to talk subsets and supersets (and forget about
DOCTYPES) then:

If H is the set of all possible valid HTML documents; and X is the set of
all possible valid XHTML documents, then there exists a non-empty set A
such that A⊂H and A⊂X, as illustrated by listing 1, which is a member
of set A.

However, as shown by listing 2, there exists a document h such that h∈H,
but h∉X. And as shown by listing 3, there exists a document x such that
x∉H, but x∈X. These last two findings show that H⊄X and X⊄H.

FWIW, I think that whether you're using XHTML or HTML, it's usually good
practice to aim for your documents to be as close to set A as possible.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Mar 4 '06 #12
On 3 Mar 2006 02:56:26 -0800, "Peter Williams" <p8****@gmx.net > wrote:
Apart form some trivialities (eg swapping DOCTYPE) correct XHTML is a
superset of correct HTML ?


No.

You should read Hixie's paper. This paper is bogus, because it describes
difficulties in achieving something that no-one wants to do - but it
seems that you actually want to !

HTML and XHTML should be seen as two separate end results of diverging
content-management tasks. It's usually easy to produce either on demand
but his idea of "simultaneo usly being both" is both impossibly
difficult, and pointless.

Mar 6 '06 #13
On Mon, 6 Mar 2006, Andy Dingley wrote:
You should read Hixie's paper. This paper is bogus, because it
describes difficulties in achieving something that no-one wants to
do
Oh, I dunno about that - I've seen several cases of people who
appeared to want to do what it describes (that is, until it was
explained to them what they'd need - and then they went right off the
idea).

The problem with Hixie's paper is that it over-states the case with
such details, giving people who want to diss it ("bogus", your choice
of words) the opportunity to ignore the substantive message which it
also contains.
HTML and XHTML should be seen as two separate end results of
diverging content-management tasks. It's usually easy to produce
either on demand but his idea
"his" idea? That isn't how I read it.
of "simultaneo usly being both" is both impossibly difficult, and
pointless.


No disagreement there. But I don't interpret that as Hixie's point,
and it doesn't contradict the substantive content of his rant.

One message that I take from his rant is that the majority of
soi-disant "XHTML" on the web today is in fact XHTML-flavoured tag
soup, fit only to be served as text/html under the extensive fixup
heuristics of bad old HTML. As genuine XHTML, it is bogus: as
"XHTML/1.0 Appendix C" it is bogus too. It carries all of the old
ballast of only "working" (for some small values of the term
"working") in the presence of a whole menagerie of browser fixups.

So the provisions of "Appendix C" have given us a whole new legacy of
defective markup, containing all of the disadvantages which had
accrued in HTML du jour, and from which XHTML was supposed to rescue
us, PLUS some whole new legacy problems based on widespread
misunderstandin gs of XHTML and of Appendix C.

It would have been better to convince those authors to stay with
legacy HTML unless/until they understood XHTML. And draw a firm line
under the fixup heuristics of HTML, make a clean break and a clean
start. But it's too late for that now: the new legacy is already
there. Ho hum.
Mar 6 '06 #14

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

Similar topics

16
7117
by: Mcginkel | last post by:
I am trying to find a way to load XHTML content in an Iframe. I use to do this in html by using the following code : var iframeObject = document.createElement("iframe"); MyDiv.appendChild(iframeObject); var data = "<html><head><title>testing</title></head><body>data</body></html>" iframeObject.contentDocument.open(); iframeObject.contentDocument.writeln(data);
12
2415
by: Alex D. | last post by:
How can I stop asp.net from rendering XHTML istead of HTML? My javascripts are rendering wrong because of that. It is rendering &amp; to clients instead of &. Any help? Thanks, Alejandro.
6
433
by: Guy Macon | last post by:
cwdjrxyz wrote: HTML 5 has solved the above probem. See the following web page: HTML 5, one vocabulary, two serializations http://www.w3.org/QA/2008/01/html5-is-html-and-xml.html
0
9645
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6739
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.