Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #3285

Re: Question about new lines

Message-ID <1766467.D2KPVSPYKU@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2011-10-03 14:51 +0200
Subject Re: Question about new lines
Newsgroups comp.lang.php
References (3 earlier) <xn0hjw4t3oa6h3401s@news.individual.net> <j6be24$k8h$4@news.albasani.net> <xn0hjwx4covevi801t@news.individual.net> <j6c64g$joe$2@dont-email.me> <xn0hjx364p3laq801u@news.individual.net>
Followup-To comp.lang.php

Followups directed to: comp.lang.php

Show all headers | View raw


Jeff Gaines wrote:

> Jerry Stuckle wrote:
>> Which isn't valid on html - only xhtml or xml.
> 
> There seems to be confusion about whether or not the / is optional.

Yes, that only *seems* to be so.

> In reality, of course, all browsers honour it.

Your logic is flawed.  You simply cannot know about *all* browsers.

AISB, *some* browsers, perhaps the majority in terms of market share, do not 
implement the SGML Declaration for HTML 4.01 [1] properly, which specifies 
the SHORTTAG syntax for HTML so that `<br />' is equivalent to `<br>&gt;' in 
HTML (that allows, for example `<h1/My Title/' instead of `<h1>My 
Title</h1>') [2].  But the W3C Validator [3] does, which is why, e. g.,

  <link … rel="…" … />

is _not_ a Valid HTML 4.01 fragment (as `&gt;' would be character data which 
is not allowed within the `HEAD' element).

This has led to the *current* HTML5 Working Draft regarding the trailing `/' 
between `<' and the corresponding `>' of a start tag as allowed and optional 
in the HTML syntax of HTML5 [4,5].  But you SHOULD NOT rely on that
outside of HTML5, perhaps not even in HTML5 until it has become stable.


HTH

PointedEars
___________
[1] <http://www.w3.org/TR/html401/sgml/sgmldecl.html>
[2] <http://www.w3.org/MarkUp/html3/HTMLandSGML.html>
[3] <http://validator.w3.org/>
[4] <http://www.w3.org/TR/2011/WD-html5-20110525/syntax.html#start-tags>
[5] <http://www.w3.org/TR/2011/WD-html5-20110525/introduction.html#html-vs-
xhtml>
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Question about new lines Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-02 14:00 +0000
  Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-02 14:17 +0000
    Re: Question about new lines Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-02 16:36 +0000
      Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-02 21:58 +0000
        Re: Question about new lines The Natural Philosopher <tnp@invalid.invalid> - 2011-10-03 05:35 +0100
          Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 07:53 +0000
            Re: Question about new lines Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-03 11:40 +0200
            Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 07:26 -0400
              Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 11:42 +0000
                Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 08:48 -0400
                Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 13:05 +0000
                Re: Question about new lines Robert Heller <heller@deepsoft.com> - 2011-10-03 08:49 -0500
                Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 14:11 +0000
                Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 10:57 -0400
                Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 15:14 +0000
                Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 14:57 -0400
                Re: Question about new lines Mason Barge <masonbarge@gmail.com> - 2011-10-05 15:20 -0400
                Re: Question about new lines Tim Streater <timstreater@greenbee.net> - 2011-10-06 12:27 +0100
                Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 10:54 -0400
                Re: Question about new lines Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-03 14:51 +0200
          Re: Question about new lines Tim Streater <timstreater@greenbee.net> - 2011-10-06 12:21 +0100
  Re: Question about new lines The Natural Philosopher <tnp@invalid.invalid> - 2011-10-02 16:21 +0100
  Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-02 11:43 -0400
  Re: Question about new lines Denis McMahon <denismfmcmahon@gmail.com> - 2011-10-02 19:08 +0000
    Re: Question about new lines "Peter H. Coffin" <hellsop@ninehells.com> - 2011-10-02 19:57 -0500
  Re: Question about new lines Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2011-10-02 23:52 +0200
  Re: Question about new lines Gordon Burditt <gordon@hammy.burditt.org> - 2011-10-03 00:15 -0500
  Re: Question about new lines Michael Joel <no@please.com> - 2011-10-04 09:38 -0400

csiph-web