473,761 Members | 5,578 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

W3C Validator error? <br /> is valid for doctype HTML 4.01 Strict

Hi everyone,

Is the W3C HTML Validator [1] in error when it returns <br /> as valid
for HTML 4.01 Strict doctype?

In March 2004 [2], the Validator returned <br />, <hr /> and <img />
as invalid for HTML 4.01 Strict.

Liam Quinn said [2] "You can't mix HTML and XHTML. You need to choose
one or the other syntax."
[meaning: choose <br> for HTML and <br /> for XHTML]

As for today, the Validator returns <br /> and <img /> as valid for
HTML 4.01 Strict, but <hr /> (and also <meta /> and <link />)
as invalid.

It seems that the Validator has changed its behaviour since 2004.

[1] http://validator.w3.org/
[2] http://lists.w3.org/Archives/Public/...r/2003Mar/0028
Liam Quinn is a founding member of WDG (Wed Desing Group).

Thanks,
Thomas Jedenfelt
Tyresö (Stockholm), Sweden

Jul 24 '05
12 45335
Nick Kew wrote:
David Dorward wrote:
2. The author of that email was finding that <hr /> was invalid and
*assuming* that <img /> and <br /> were too. I'd suspect option 2 myself.

I wouldn't. I expect the reason for the difference was context.
Technically speaking, <hr/> & friends are valid where
bare text is allowed. Your example
I didn't give an example.
now had them inside a <p> or <div> or somesuch, whereas in the 2003
example they were not in a valid context.


That was my point, sorry if I didn't phrase it well. <hr> is often used
where bare text is not allowed while <img> and <br> can only be used where
bare text is allowed. So <hr /> would be invalid as the ">" bare text isn't
allowed there, but <img /> and <br /> pass the test.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 24 '05 #11
Thomas Jedenfelt wrote:
Currently (April 2005), the Validator validates <br /> and <img />, but
not <hr />, as HTML 4.01 Strict.
Maybe, maybe not. It depends where you use it.

http://dorward.me.uk/tmp/the-slash-issue.html
May not be valid HTML 4.01
<hr />, <hr>>, <meta />, <link />
All of those may be valid. <hr> is allowed in some places where character
data is allowed. The end tag of <head> and start tag of <body> are
optional, so if <meta /> or <link /> is the *last* element of the <head>
and the <body> and </head> tags are left out, then its valid. (<link />
becomes <link></head><body>&gt; )

Of course "valid" doesn't mean "good".
Following Liam Quinn's advice, I will use <> for HTML 4.01 Strict and
</> for XHTML, as I have done before.


Yes

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 24 '05 #12
"Thomas Jedenfelt" <th************ ****@operamail. com> writes:
Hello Yucca,

Thanks for replying.

The discussion seems to concern two issues:
Quite.

1. Inverting Korpela's 22nd law doesn't work.
2. Neither does ignoring the 3rd.
I will finnish tomorrow.


That's highly unlikely.

Yucca will be finnish tomorrow for sure, you on the other hand will
provide a minimal testcase.
A minimal testcase would approximately look like this:

<http://validator.w3.or g/check?uri=http://sandbox.bednarz .nl/.swap/gimmeabr.html&s s=1&sp=1>
(DUH! :)
--
| ) Più Cabernet,
-( meno Internet.
| ) http://bednarz.nl/
Jul 24 '05 #13

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

Similar topics

9
5883
by: loveNUNO | last post by:
I'am using xt to convert my xml with an xsl to html. When i use <br /> in my xsl document in turns into <br> in the html. So, How am I get <br/> TAG in output(html) like xhtml?
4
7863
by: fis | last post by:
Hi all, I've problem because there are needed break lines in my texts on the web site but i can't do it :( My pipeline looks like: XMS -> I18N -> XSLT -> HTML I have lot of texts in my "languages" files and these are describes for things on my website. Example text looks like this:
6
12155
by: Lasse | last post by:
I have done this simple function, it seems to work as intended, to solve a problem i have had for a while. I couldnt find any sample around that was working for me. I would like to test it with you and see if there are any improvments that i should make ;-) It should be fast and if possible compatible with todays modern browser-standards. It should be activated by the onload-event. This is my code, free for all to use:
9
9228
by: red | last post by:
If I have <span>text</span> <br> and then some text isn't there sopposed to be a line break between the span and the text ? Why do browsers ignore the <br> ?
7
19163
by: noor.rahman | last post by:
I have an XML file that stores data from an HTML form. I use XSL to display the data in HTML format. The data may have newline characters. However, XSL is not displaying the newlines properly in the browser. I even replaced all the newlines with <BR/> tags but eventhough I see the tags in my source, I don't get a line break in the output document. Any help would be greatly appreciated.
15
2730
by: tshad | last post by:
How do I go about this? I used to know this, but can't find VB.net replace that does this. Something like string.replace("<br>",NL) Thanks,
2
6594
by: PapaRandy | last post by:
Hello, I am trying to validate the following .py webpage as HTML (through W3C). I put: ----------------------------------------------------------------------------- print "Content-type: text/html; charset=utf-8"
23
2240
by: Xah | last post by:
Here's a interesting case of invalid html 4 strict file. In summary, if you have <body></bodywithout any content, the file would be invalid under html 4 strict. Valid if html 4 lose. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/ TR/html4/strict.dtd"> <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=utf-8">
0
9353
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
9975
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...
1
9909
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
9788
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
8794
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...
0
6623
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
5384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3889
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
3
3481
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.