I keep coming across people, online and in real life, who believe that
to code single tags like <br> and <img> with trailing slashes, <br />
and <img /> is considered "best practice" and when challenged, they
say that "everyone's going to be using XML/XHTML soon" and say that
they're "getting ready" by coding this way.
Coding this way causes validation errors in HTML 4 Transitional and
HTML 4 Strict, so it can't be "best practice".
But more to the point, XHTML isn't "coming one day". It's here. If
you're using it, code this way, if not, not.
It's all rather cargo-cult if you ask me.
Does anyone know where this idea started? Are they teaching it in
universities? Did some HTML guru tell people this was the way to go?
Some book, some website? The lack of logic offends me. 23 3721
Hostile17 wrote: I keep coming across people, online and in real life, who believe that to code single tags like <br> and <img> with trailing slashes, <br /> and <img /> is considered "best practice" and when challenged, they say that "everyone's going to be using XML/XHTML soon" and say that they're "getting ready" by coding this way.
I think what is considered "best practice" is writing empty elements
with a space before the trailing /, like it's explained in the "HTML
Compatibility Guidelines" <http://www.w3.org/TR/xhtml1/#guidelines>:
* * *
C.2. Empty Elements
Include a space before the trailing / and > of empty elements, e.g. <br
/>, <hr /> and <img src="karen.jpg" alt="Karen" />. Also, use the
minimized tag syntax for empty elements, e.g. <br />, as the alternative
syntax <br></br> allowed by XML gives uncertain results in many existing
user agents.
* * *
My guess is that somebody misunderstood the "HTML" in the title. These
guidelines are for compatibility with HTML *user agents*, not with the
HTML *document type*.
Matthias
On 16 Sep 2003 21:21:54 -0700, ho*******@bigfo ot.com (Hostile17)
wrote: But more to the point, XHTML isn't "coming one day". It's here. If you're using it, code this way, if not, not.
XHTML is not here today, in that the majority of browsers don't
support it, and don't claim to support it, if you believe XHTML is
here today then <br /> is fine - it's tag-soup just like the rest of
XHTML served as text/html.
Does anyone know where this idea started? Are they teaching it in universities ?
XHTML evangelists have done a lot of gibberish...
Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jim Ley wrote: On 16 Sep 2003 21:21:54 -0700, ho*******@bigfo ot.com (Hostile17) wrote:But more to the point, XHTML isn't "coming one day". It's here. If you're using it, code this way, if not, not.
XHTML is not here today, in that the majority of browsers don't support it, and don't claim to support it, if you believe XHTML is here today then <br /> is fine - it's tag-soup just like the rest of XHTML served as text/html.
How can XHTML served as text/html be any more or less tag-soup than
non-X-HTML? To me there is only a syntactical difference, and whichever
flavor you prefer (x or not) should do just fine in browsers. I find
XHTML easier to parse (by my tools as well as my brain, if you know
what I mean), that's why I use it.
I don't need to know about the doctype to create the document tree. In
HTML I need to know for every element what's it all about, e.g. I don't
know if
<p>test<br>test <p>test
means
p
|
-- br
|
-- p
or
p
|
-- br
|
p
.... in other words, wether or not the second p is next sibling or child
node. I don't know without the DTD.
If you write
<p>test<br />test</p><p>test</p>
it'd be quite obvious without parsing the DTD. So I suppose someone
came up with the thought that adding the <br /> to HTML would make some
sense, maybe to human readers. Well, just some explanation. I guess
someone was just confused. It just seems plain dumb to use <br /> in
non-X-HTML. Even though browsers just won't care. Just bad for using
validation tools.
Anyway. There's a certain tendency on many websites to pretend XHTML1
has some accessibility or other bonus (like search engine optimization)
compared to HTML4 which is of course just legend.
To say "XHTML is not supported by the majority of browsers" like you do
however seems to be starting just another legend. Not that you're not
right (XHTML as XML application, etc.), but more in the sense of how
it'd be understood by most people ("Oh, I can't use XHTML in most
browsers" -- yes you can).
--
Google Blogoscoped http://blog.outer-court.com
On 17 Sep 2003 09:15:38 GMT, "Philipp Lenssen" <in**@outer-court.com>
wrote: Jim Ley wrote: On 16 Sep 2003 21:21:54 -0700, ho*******@bigfo ot.com (Hostile17) wrote: >But more to the point, XHTML isn't "coming one day". It's here. If >you're using it, code this way, if not, not. XHTML is not here today, in that the majority of browsers don't support it, and don't claim to support it, if you believe XHTML is here today then <br /> is fine - it's tag-soup just like the rest of XHTML served as text/html.
How can XHTML served as text/html be any more or less tag-soup than non-X-HTML?
Valid HTML 4.01 could be parsed as HTML, and achieve reliable results,
XHTML shorttags won't they need tag-soup parsing. There's no
difference between XHTML and tag-soup HTML, all of it relies on the
browsers being able to fix up tag-soup.
To me there is only a syntactical difference, and whichever flavor you prefer (x or not) should do just fine in browsers.
In tag-soup ones, yeah they'll almost certainly do fine, however with
xhtml you're relying on tag-soup parsing where it's up to the browser
to work out what you intended, and not some formal specification. If
you're content that's okay, then that's fine. XHTML evangelists have
represented XHTML as more than this, suggesting it is in some way
superior to other approaches, when it's really just the same old tag
soup as other invalid HTML.
I find XHTML easier to parse (by my tools as well as my brain, if you know what I mean), that's why I use it.
That's fine, I'm sure any CIWAH reader is up to making their own
decisions through the mess and decide that tag-soup parsing is
reliable enough, it's when half a message gets outside ciwah and
people take half of that and end up with a garbled mess, like the OP's
story.
To say "XHTML is not supported by the majority of browsers" like you do however seems to be starting just another legend. Not that you're not right (XHTML as XML application, etc.), but more in the sense of how it'd be understood by most people ("Oh, I can't use XHTML in most browsers" -- yes you can).
Good old fashioned Tag-Soup works just great too, should I advocate
that instead? XHTML tag-soup is just as distasteful as other
tag-soups, it's all relying on the lax parsing of browsers.
Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jim Ley wrote: On 17 Sep 2003 09:15:38 GMT, "Philipp Lenssen" <in**@outer-court.com> wrote:
How can XHTML served as text/html be any more or less tag-soup than non-X-HTML?
Valid HTML 4.01 could be parsed as HTML, and achieve reliable results, XHTML shorttags won't they need tag-soup parsing. There's no difference between XHTML and tag-soup HTML, all of it relies on the browsers being able to fix up tag-soup.
To me there is only a syntactical difference, and whichever flavor you prefer (x or not) should do just fine in browsers.
In tag-soup ones, yeah they'll almost certainly do fine, however with xhtml you're relying on tag-soup parsing where it's up to the browser to work out what you intended, and not some formal specification.
I think your definition of tag-soup is "not 100% valid", e.g. any XHTML
send out as text/html woul be tag-soup because XHTML should be served
as XML application.
I have a different definition; tag-soup is garbage HTML with a lot of
redundancy, one that becomes hard to manage, complex to parse,
error-prone, incompatible for cross-browser/ cross-media rendering, and
so on.
"Not 100% valid" in this case is OK to me because it's very easy to
switch from content-type X to content-type Y. It is not easy to e.g.
switch from table-layout to CSS-layout; simply not possible by just
switching a server-setting. Besides, the validator still works, so I
can check for bugs I need be concerned about.
In Germany we say "Das Kind mit dem Bade ausschutten" for what seems
you're doing with XHTML. I think there's a similar phrase in English; http://forum.leo.org/archiv/2002_06/...31146e_en.html
--
Google Blogoscoped http://blog.outer-court.com
On 17 Sep 2003 09:57:30 GMT, "Philipp Lenssen" <in**@outer-court.com>
wrote: "Not 100% valid" in this case is OK to me because it's very easy to switch from content-type X to content-type Y. It is not easy to e.g. switch from table-layout to CSS-layout; simply not possible by just switching a server-setting.
What does table/CSS layout have to do with an XHTML/HTML decision or
you suggesting that CSS doesn't work with HTML?
In Germany we say "Das Kind mit dem Bade ausschutten" for what seems you're doing with XHTML. I think there's a similar phrase in English; http://forum.leo.org/archiv/2002_06/...31146e_en.html
XHTML 2.0 could be useful (I doubt it, it still seems much to limited
to be a successor to me, if we're going to have a step-change to new
user agents we might aswell go to a very rich mark-up language) but
XHTML has nothing that HTML doesn't.
Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jim Ley wrote: On 17 Sep 2003 09:57:30 GMT, "Philipp Lenssen" <in**@outer-court.com> wrote:
"Not 100% valid" in this case is OK to me because it's very easy to switch from content-type X to content-type Y. It is not easy to e.g. switch from table-layout to CSS-layout; simply not possible by just switching a server-setting.
What does table/CSS layout have to do with an XHTML/HTML decision or you suggesting that CSS doesn't work with HTML?
No, I'm not. It seems to me you equal XHTML with tag-soup. I was giving
an example of what I understand to be tag-soup (like table-layout
without signs of CSS). So in my understanding tag-soup covers XHTML as
well as HTML, and can also be avoided in both. In Germany we say "Das Kind mit dem Bade ausschutten" for what seems you're doing with XHTML. I think there's a similar phrase in English; http://forum.leo.org/archiv/2002_06/...31146e_en.html
XHTML 2.0 could be useful (I doubt it, it still seems much to limited to be a successor to me, if we're going to have a step-change to new user agents we might aswell go to a very rich mark-up language) but XHTML has nothing that HTML doesn't.
It is a little easier to create a document tree, because all you need
is a general XML-document-tree generator -- you don't need to know the
specific document type. Same for unquoted attributes -- in XHTML you
cannot leave attributes unquoted, so again a parser tool analyzing
XHTML could be a little easier to write. This argument alone is not
that valuable except for my own little tools, and because it seems to
make XHTML slightly simpler and more elegant.
But it seems you are suggesting XHTML is not usable for some reason
because of the lack of browser support, whereas I would say it's just
as usable as non-X-HTML, so everybody should use whatever they prefer
for whatever reasons -- it won't make a difference to the end-user
(unless you're using the <?xml ..> line, which shows in some older
browsers e.g. on Mac).
--
Google Blogoscoped http://blog.outer-court.com
Jim Ley wrote: On 16 Sep 2003 21:21:54 -0700, ho*******@bigfo ot.com (Hostile17) wrote:
But more to the point, XHTML isn't "coming one day". It's here.
XHTML is not here today, in that the majority of browsers don't support it
Most newer browsers do: Mozilla, Netscape, Opera, Konqueror, Safari,
Amaya ... A certain outdated browser that a certain megalomaniacal
monopoly keeps forcing on people doesn't, nor do browsers that list HTML
3.2 support as a feature.
On 17 Sep 2003 11:03:22 GMT, "Philipp Lenssen" <in**@outer-court.com>
wrote: But it seems you are suggesting XHTML is not usable for some reason because of the lack of browser support, whereas I would say it's just as usable as non-X-HTML, so everybody should use whatever they prefer for whatever reasons
The problem with feeding tag-soup to tag-soup browsers is it that
perpetuates the idea that tag-soup is the way to author, all XHTML
served as text/html is treated as tag-soup, therefore there's no
advantage whatsoever in serving valid or invalid XHTML, people are
free to serve whatever they want, safe in the knowledge that it will
be rendered much the same. Without the constraints of validity,
what's the advantage of XHTML?
Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Christopher Reeve |
last post by:
Hi, I wonder if anyone could help me. I am moving accross from C to
C++ and am writing a program that reads and writes data into a file. I
am aware of the old C ways of doing it but am trying to use the C++
functions which don't seem to be working propperly.
I need to open the file for reading and writing because I want to
search for a possition in a file called settings.dat and then write a
number after a certain chatacter. However when...
|
by: Jason Morehouse |
last post by:
Hello,
Anyone know if it's possible to speak with the server via xmlhttp.open
while the browser is doing a post -- file upload in this case:
<form enctype="multipart/form-data" action="product" method="post"
name="product" onSubmit="do_action_form(); return true;">
....
<script>
// .. setup xmlhttp here.
|
by: apple |
last post by:
UDBV8 fp 6a - AIX 5.1
We have scheduled cron jobs to do backups. Periodically and starting to
occur more frequently, a backup fails with this error:
SQL2072N Unable to bind the shared library "". Reason code: "".
We are backing up to a file system on the server. Can't find anything
in the logs. We can manually resubmit the job 15 or 30 minutes later
and everything works fine. Any ideas on what might be happening? The
documentation on...
|
by: Just Me |
last post by:
In code I check to see if the Floppy drive is ready and display it's state.
But if the user inserts or removes a floppy disk I need an event or a
Wndproc message to cause the code to display the new state.
Is the some way the code can be alerted to the fact that a removable disk
drive's state changed?
I wonder if the above isn't clear.
|
by: Ian Davies |
last post by:
Hello
I have the following sql string to run as a command in my VB6 project to
update mysql table
strSQL = "LOAD DATA INFILE " & ImportFile & " INTO TABLE tPupils FIELDS
TERMINATED BY ',' ENCLOSED BY ' " ' LINES TERMINATED BY '\n';"
Problem is the double quote at position ......" ' LINES......
causes the command to fail thinking the double quote is ending the SQL but
| |
by: mrajsenkumar |
last post by:
Hi I am using windowsCE 5.0, here i am try to deploy the project. but i got error message - "Connection failed. Device is not ready." tell me how to solve this problem.very urgent. i am using vs2005.
|
by: David Thielen |
last post by:
Hi;
We have our app up on a beta server. Sometimes people from outside the
firewall get "The page cannot be displayed" when they try to access it. A
couple of weird things about this:
1) If someone inside the firewall accesses it, that always works.
2) If someone inside the firewall accesses it, then the person outside can
access it. It's as though an inside connection is needed to wake it up.
|
by: thepisu |
last post by:
I have a Windows 2003 Server with IIS 6, PHP with CGI.
Yesterday I decided to update from PHP 5.1.4 to 5.2.1, but "slash
arguments" (in a Moodle installation) stop working, I mean addresses
like this:
http://www.mysite.com/file.php/folder/File.zip
Where, file.php is the script for downloading, and "folder/File.zip"
is the file to download.
|
by: =?Utf-8?B?VGFsYWxTYWxlZW0=?= |
last post by:
if i put slash("/") i mean just a / at the end of url then .aspx page
couldn't load the css and images.
i have a portal in .net if any body puts / at the end of url that page
couldn't load the css and images.
example: http://testURL/TestPortal/test5/test16.aspx/
after / insert at the end of url website will loose its formattings and its
images..
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |