473,915 Members | 4,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML compliance

Where is the official documentation of what constitutes a minimally
compliant HTML file?

--
http://www.standards.com/; See Howard Kaikow's web site.
Jul 23 '05 #1
54 3944
Howard Kaikow wrote:
Where is the official documentation of what constitutes a minimally
compliant HTML file?


http://w3.org/TR/html4/ - although I don't think it is spelt out in so many
words.

At a minimum an HTML 4.01 Strict document must contain the Doctype, a title,
and some content (which much be in a block level element since the body
element[1] cannot hold character data directly).

However, its good practise to include the HTML, HEAD, and BODY tags too
since browsers don't usually implement HTML as an SGML application.

[1] The tags for the body element are optional, but it still exists.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #2
In article <co************ *******@news.de mon.co.uk>,
David Dorward <do*****@yahoo. com> writes:
At a minimum an HTML 4.01 Strict document must contain the Doctype, a title,
and some content


Not *content*, just sufficient *markup* to imply the necessary parts
of a structure.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"><title//<p/

To the OP: your answer is 42.

--
Nick Kew
Jul 23 '05 #3
Nick Kew wrote:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"><title//<p/


Yes, while that is technically valid, the OP should be aware the most
user agents do not support the SHORTTAG syntax used in that example. A
minimally conforming document, that will also be parsed correctly in all
user agents:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"><title></title><p>

Ignoring the whitespace differences [1] for now, the above is equivalent
to the following, and will produce an identical DOM.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title></title>
</head>
<body>
<p></p>
</body>
</html>

[1] Note: Whitespace does actually result in a text node within the DOM,
but for the purpose of this example, it can be ignored.

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://SpreadFirefox.com/ Igniting the Web
Jul 23 '05 #4
Lachlan Hunt said the following on 12/04/04 13:47:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

To get browsers in Standards Compliance Mode I would add the URL to the
DTD, like the DTD itself says in "Typical usage":

http://www.w3.org/TR/html401/sgml/dtd.html

or

http://www.w3.org/TR/html401/strict.dtd

--
Regards
Harrie
Jul 23 '05 #5
I am looking for a formal spec that states the REQUIREMENTS, not the
recommendations .
I ask because I've encountered HTML file that has no DOCTYPE, HTML or BODY
tags and the creator is insisting that such a file is conforming.
Jul 23 '05 #6
On Sat, 4 Dec 2004, Harrie wrote:
To get browsers in Standards Compliance Mode I would add the URL to
the DTD,
Yes, but that's a completely different issue. It has nothing at all
to do with whether the HTML document itself is compliant to its DTD.

Don't confuse issues of SGML compliance, which are purely formal, with
details of heuristic behaviour by browsers du jour.

And the decision to (mis)interpret these details of a DTD as being
the author's advertisement of "this is tag-soup" versus "this is real
HTML" can only be described as heuristic, IMNSHO.
like the DTD itself says in "Typical usage":


Erm, to be pedantic, the /comments/ that you find in a DTD are in no
way normative. Some of them are even misleading - see the comment in
the DTD relating to the IMG's ALT attribute - it's in fundamental
contradiction to what the body of the HTML specification says, and the
latter is what the WAI deem to be good practice. Me too, as it
happens.
Jul 23 '05 #7
In case anyone's interested, here is the HTML, with real info replaced.
Could this really be strictly conforming HTML?
------------------------------------------------
<title>Billin g status</title>
<h2>Usage shown for 11/2004</h2>

This only covers a single month, and does not take
into consideration any previous balance.
<br>
(the information displayed may not include any current connections
or connections terminating within the last 25 minutes)

<hr>
<pre>
Account: xxxxxx-yy
Edward Bagels
Edward Bagels
xx yyy zzzz
aaaaaa, bb 12345-6789
Home Phone: (000) 555-1212
FAX:
Billing contact: Edward Bagels
email: no****@ishome.b iz
Discount: ggggg (20.0%)
Created: 87654321
Closed: not
Billing Method: email
Bill To: no****@ishome.b iz
-----
T Name # Usage Level Price Total
I aaaaaaaaaa 229 162:36:17 Normal rr.ss tt.00 -ggggg
created 11111111 closed: not
-----
T Name Level Price Total
W ggggggg/aaaaaaaaaa Standard 0.00 0.00 -ggggg
www.aaaaaaaaaa.biz Alias q.00 h.00
created 22222222 closed: not
-----
T Domain Name Minimum Price Total
N aaaaaaaaaa.biz 0.00 0.00 -ggggg
created 33333333 closed: not
-----
Price: $ aa.bb
Discounts applied: $ v.bb
Minimum for accounts: $ rr.00
Total charges: $ rr.00
Note: usage information shown here may only be accurate as of
the most recent data gathering cycle, and does not include
credits, debits, etc.
This is not an invoice.
</pre>
<hr>
<p>
Jul 23 '05 #8
Alan J. Flavell said the following on 12/04/04 14:49:
On Sat, 4 Dec 2004, Harrie wrote:
To get browsers in Standards Compliance Mode I would add the URL to
the DTD,


Yes, but that's a completely different issue. It has nothing at all
to do with whether the HTML document itself is compliant to its DTD.


Agreed. I just wanted to add it so the OP knows about different formats
of DOCTYPE and what it triggers, but you're right, it has nothing to do
with SGML compliance.
like the DTD itself says in "Typical usage":


Erm, to be pedantic, the /comments/ that you find in a DTD are in no
way normative. Some of them are even misleading - see the comment in
the DTD relating to the IMG's ALT attribute - it's in fundamental
contradiction to what the body of the HTML specification says, and the
latter is what the WAI deem to be good practice. Me too, as it
happens.


I just added that as an example, but thanks for your remark, I wasn't
aware of that. I appreciate pedantic remarks, especially with technical
discussions, so I can keep learning.

--
Regards
Harrie
Jul 23 '05 #9
On Sat, 4 Dec 2004 08:35:07 -0500, Howard Kaikow <ka****@standar ds.com>
wrote:
I am looking for a formal spec
The HTML 4.01 Specification (<URL:http://www.w3.org/TR/html4>) as produced
by the W3C is the normative document for the current version of HTML.
that states the REQUIREMENTS, not the recommendations .
You've been told the requirements: a DOCTYPE, a TITLE element, and some
form of content within the BODY element. What that content can be depends
on the DOCTYPE used: for Strict, a block-level element or SCRIPT element;
for Transitional, any element or text.
I ask because I've encountered HTML file that has no DOCTYPE, HTML or
BODY tags
It's already been stated that in HTML the start and end tags for the HTML,
HEAD and BODY elements are optional. The elements are always present, but
they don't need to be specified explicitly. They usually are though for
clarity.

For a document to be valid, it must include a DOCTYPE declaration. From
section 7.2 - HTML version information:

"A valid HTML document declares what version of HTML is used in the
document. The document type declaration names the document type
definition (DTD) in use for the document..."

and from section 4.2 - SGML, paragraph 2:

"For the sake of brevity, most of the examples in this
specification do not begin with the document type declaration that
is mandatory at the beginning of each HTML document."
and the creator is insisting that such a file is conforming.


That person is wrong.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #10

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

Similar topics

13
2943
by: Ben Sharvy | last post by:
Is there a list of the changes you need to make to HTML 4.1 cose to make it dual compliant, with XHTML 1.1 also?
32
3260
by: Werner Partner | last post by:
I put this question already, but erhaps it "came under the wheels" because it was hidden in another thread. Nevertheless it's important for me to understand the problem and solve it. Old html 4.01 Standard: http://www.sonoptikon.de/kairos/kontakt.php The crucial lines are: ------------------- <table cellpadding=4 cellspacing=1 width="100%">
81
5223
by: sinister | last post by:
I wanted to spiff up my overly spartan homepage, and started using some CSS templates I found on a couple of weblogs. It looks fine in my browser (IE 6.0), but it doesn't print right. I tested the blogs, and one definitely didn't print right. Surveying the web, my impression is that CSS is very unreliable, because even updated browsers fail to implement the standards correctly. So should one just avoid CSS? Or is it OK if used...
100
7061
by: Roose | last post by:
Just to make a tangential point here, in case anyone new to C doesn't understand what all these flame wars are about. Shorthand title: "My boss would fire me if I wrote 100% ANSI C code" We are discussing whether this newsgroup should focus on 100% ANSI C or simply topics related to the C language in the real world. There is a C standard which is defined by an international committee. People who write compilers refer to this in...
7
3693
by: Kersh | last post by:
I'm trying to implement XHTML standards in my ASP.NET web pages but whenever I use web controls I get problems because of the very strict nature of W3C XHTML (transitional version is picky but strict1.1 very severe!) e.g. align="Center" fails validation because of the capital "C" - this makes asp:Calendar control unuseable because it happens to use this tag for each of the cells. Also Javascript tags require a 'type' attribute...etc
4
1981
by: clintonG | last post by:
Technically speaking, this issue is not about modifying the HTML generated by server controls but preceding the HTML generated by server controls with an HTML control generated on the basis of the type and the context of the server control itself. Clear as mud? :-) Consider the following server control... <asp:textbox id="MemberEmail" runat="server" ></asp:textbox> TextBox renders at run-time as an HTML control... <input...
40
5644
by: VK | last post by:
Hi, After the response on my request from W3C I'm still unclear about Tidy vs. Validator discrepansies. That started with <IFRAME> issue, but there is more as I know. Anyway, this very basic HTML page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html401/strict.dtd"> <html> <head>
41
4565
by: deko | last post by:
A web page can be created using either strict or transitional HTML. The DOCTYPE for strict is: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> And transitional: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
2566
by: Number 11950 - GPEMC! Replace number with 11950 | last post by:
HTML to RTF conversion is done by the clipboard in certain circumstances. Does anyone know of an API or possibly a Framework2 class.method that will convert HTML to RTF...? TIA -- Timothy Casey GPEMC! >11950 is the number@fieldcraft.com.au 2email Terms & conditions apply. See www.fieldcraft.biz/GPEMC Discover valid interoperable web menus, IE security, TSR Control, & the most advanced speed reading application @ www.fieldcraft.biz
0
9881
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
11354
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...
0
10923
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10542
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
9732
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8100
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
7256
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
6148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4778
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.