FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: PHP [message #171404 is a reply to message #171365] Sat, 01 January 2011 22:30 Go to previous messageGo to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
Denis McMahon wrote:

> On 30/12/10 19:15, richard wrote:
>> No end tag for a <br>? Since when was that needed?
>
> If the specified DTD is XHTML, I think all tags have to be closed.

Even if it is HTML, all tags have to be closed (with TAGC) as most UAs do
not implement SGML correctly. You mean something else. Tags are _not_
elements:

<http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2.1>

> For elements which have empty content models, you close the tag using
> the sequence space-slash-right_angle_bracket or " />"

The leading space is not required in XHTML except for so-called HTML
compatibility.

> <meta http-equiv="Content-Type" content="application/xhtml+xml;
> charset=utf-8" />

An XML parser could not care less about this element as the document needs
to be well-formed before that. Again, this is for "HTML compatibility"
only, and only required in the first place when the document is not viewed
via HTTP and the encoding is not otherwise declared (in XHTML, it can be
declared with a PI before the root element, but that forces some browsers
into Compatibility Mode when served as text/html; however, declaring UTF-8
is never necessary for an XML parser as it is one of the XML default
encodings).

> or
>
> <br />

<br/> or <br></br> would suffice in XHTML, unless it needs to be "HTML-
compatible".

BTW, I have recently learned that the nl2br() function has been added a
second parameter with which you can specify whether you want HTML BR
elements or HTML-compatible XHTML `br' elements in the return value.

<http://php.net/nl2br>


PointedEars
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300dec7(at)news(dot)demon(dot)co(dot)uk> (2004)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problem with zend anx ajax
Next Topic: Shocking amount of PHP security holes?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 04:50:21 GMT 2024

Total time taken to generate the page: 0.05197 seconds