473,597 Members | 2,095 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 3891
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
2920
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
3215
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
5138
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
6901
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
3673
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
1971
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
5571
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
4378
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
2550
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
7965
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7885
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
8258
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...
1
5847
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
5426
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
3881
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...
0
3923
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1493
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1231
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.