473,799 Members | 3,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML and XHTML


Hello,

What is the difference between HTML and XHTML...

Thanks,
------------------------------------------------------------------------
IT Interview Questions : http://www.geekinterview.comIT Tutorials and Articles : http://www.geekarticles.com
Oct 11 '05
32 2950
On Thu, 13 Oct 2005 11:58:26 +1000, in
comp.infosystem s.www.authoring.html , Mark Parnell
<we*******@clar kecomputers.com .au> in
<43************ ***********@per-qv1-newsreader-01.iinet.net.au > wrote:
In our last episode, Gus Richter <gu********@net scape.net> pronounced to
comp.infosyste ms.www.authoring.html:
Andy Dingley wrote:

HTML must have all elements closed, just as XHTML must.


The HTML 4.01 spec shows 15 end tags that are optional, of which 4 start
tags are also optional.


Which is why Andy went on to clarify:
The difference is that SGML allows elements to be
closed by inference from the DTD and the appearance of some other
element that couldn't be contained inside the current element (implying
necessary closure)


IOW, all elements have to be closed in both HTML and XHTML, but HTML is
capable of closing some of them automatically, whereas XHTML has to be
specifically told to close them.


From my POV as a developer, if I don't have to do it, then it does not
matter. It something is done implicitly then I don't necessarily know
when it is done. So the XHTML is more restrictive *on me*.

--
Matt Silberstein

Do something today about the Darfur Genocide

Genocide is news | Be A Witness
http://www.beawitness.org

"Darfur: A Genocide We can Stop"
www.darfurgenocide.org

Save Darfur.org :: Violence and Suffering in Sudan's Darfur Region
http://www.savedarfur.org/
Oct 13 '05 #21
On Thu, 13 Oct 2005 14:17:49 +1000, in
comp.infosystem s.www.authoring.html , Mark Parnell
<we*******@clar kecomputers.com .au> in
<43************ ***********@per-qv1-newsreader-01.iinet.net.au > wrote:
In our last episode, Gus Richter <gu********@net scape.net> pronounced to
comp.infosyste ms.www.authoring.html:
Thank you for that, but as I understand the question, it is regarding
document creation in using HTML vs. XHTML and not how the browser is to
parse optional tags within an HTML document, or where/how am I missing
the relevance?
The OP simply asked what the difference between HTML and XHTML was. The
context wasn't specified. Matt's question, which Andy was responding to,
seems to me to be concerned with the way browsers handle the languages,
rather than authoring.


I had meant as an author, sorry for the confusion. Why would I care
about browsers? That is almost like caring about users. ;-)
Either way, Andy's statement was correct, regardless of whether it
answered the question. :-)


And that is all that really matters, isn't it? ;-)
--
Matt Silberstein

Do something today about the Darfur Genocide

Genocide is news | Be A Witness
http://www.beawitness.org

"Darfur: A Genocide We can Stop"
www.darfurgenocide.org

Save Darfur.org :: Violence and Suffering in Sudan's Darfur Region
http://www.savedarfur.org/
Oct 13 '05 #22
Eric B. Bednarz said the following on 10/13/2005 21:33 +0200:
Harrie <sp*****@linux. org.invalid> wrote:
Lachlan Hunt said the following on 10/13/2005 19:24 +0200:
It's an XML DTD. It's similar to an SGML DTD, but not quite the
same.


It doesn't begin with an xml prologue, or am I too narrow minded?
I ment an XML declaration here, but that's part of a prolog.
Pardon? A DTD is *part* of the prolog -- it's an optional part of the
document type declaration which itself is an optional part of the
prolog.
Of the document, yes, but I was talking about the DTD itself. The DTD looks like SGML to me, I can't see it's XML. But I just read in my XML book that a document prolog is optional, so I can't conclude from not seeing an XML declaration that it's not XML (I think this is what you refer to in your last sentence).

Still, I would expect some (hopefully clear) differences between SGML and XML DTD's.
Can you give me some pointers where an XML DTD is explained?


The XML spec would be a good guess, I guess.
<http://www.w3.org/TR/REC-xml/#elemdecls>
<http://www.w3.org/TR/REC-xml/#sec-entity-decl>


Thanks, I've read most of the XML Recommandation before, but I'll study it again, I might have missed something.
(note that XML markup declarations have just some restrictions compared
to SGML, so you might be able to look at an arbitrary external DTD
entity and possibly determine 'this cannot be an XML DTD', but you
cannot conclude 'this *is* an XML DTD')


I think this is where my confusion is based on. It's those restrictions compared to SGML I'm looking for and try to understand.

--
Regards
Harrie
Oct 13 '05 #23
Harrie <sp*****@linux. org.invalid> wrote:
Pardon? A DTD is *part* of the prolog -- it's an optional part
of the document type declaration which itself is an optional part
of the prolog.
Of the document, yes, but I was talking about the DTD itself.


The DTD is also part of the document.
The
DTD looks like SGML to me, I can't see it's XML. But I just read
in my XML book that a document prolog is optional so I can't
conclude from not seeing an XML declaration that it's not XML
DTDs don't have XML declarations. _Documents_ have XML declarations
in the prolog, of which the DTD also is a part, like Eric Bednarz
said.

Also, to be pedantic, the prolog is technically not optional. It's
always there, but it doesn't have to contain anything:

prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
Still, I would expect some (hopefully clear) differences between
SGML and XML DTD's.


See http://www.w3.org/TR/NOTE-sgml-xml.html

--
David Håsäther
Oct 13 '05 #24
Gus Richter wrote:
I'm not negating your points at all. I think that your points are well
made and are good to know. I do, however, think that in the context of
this discussion, a new author may be mislead or confused regarding the
differences between HTML and XHTML by the statement:

"HTML must have all elements closed, just as XHTML must."


You snipped this bit: "The difference is that SGML allows elements to be
closed by inference from the DTD and the appearance of some other
element that couldn't be contained inside the current element (implying
necessary closure) - XML however doesn't have this ability and so all
elements must be closed explicitly in the document source."

HTML must have all elements closed, but it doesn't need to have all elements
closed explicitly.
--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Oct 13 '05 #25
"David Hï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½" said the following on 10/13/2005 23:36 +0200:
Harrie <sp*****@linux. org.invalid> wrote:
Pardon? A DTD is *part* of the prolog -- it's an optional part
of the document type declaration which itself is an optional part
of the prolog.
Of the document, yes, but I was talking about the DTD itself.


The DTD is also part of the document.


The Document Type Declaration is part of the document, the Document Type Definition is refered to by the former, but I was talking about an external DTD like:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd

I was expection an XML declaration there, but as I said earlier, that expectation is wrong, since it's optional.
The
DTD looks like SGML to me, I can't see it's XML. But I just read
in my XML book that a document prolog is optional so I can't
conclude from not seeing an XML declaration that it's not XML


DTDs don't have XML declarations. [..]


Why? Isn't an XHTML DTD an XML file itself (in the way than an XSL file is an XML file)? If not, is it SGML (I think not, Lachlan Hunt said it's XML, if I interpret him correctly), or what else is it? That's my confusion.
[..] _Documents_ have XML declarations
in the prolog, of which the DTD also is a part, like Eric Bednarz
said.
On which I agreed, but I wasn't refering to a document itself.
Also, to be pedantic, the prolog is technically not optional. It's
always there, but it doesn't have to contain anything:

prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?


Hmmm, so the prolog my be empty, but what does 't look like then, an empty line?
Still, I would expect some (hopefully clear) differences between
SGML and XML DTD's.


See http://www.w3.org/TR/NOTE-sgml-xml.html


It looks like this is what I nead to read, thanks a lot!

--
Regards
Harrie
Oct 13 '05 #26
Harrie wrote:
"David Håsäther" said the following on 10/13/2005
Also, to be pedantic, the prolog is technically not optional. It's
always there, but it doesn't have to contain anything:

prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?


Hmmm, so the prolog my be empty, but what does 't look like then, an
empty line?


No, if it's empty, it doesn't look like anything. A document is defined as:

[1] document ::= prolog element Misc*

and the prolog is defined as above. So, the prolog is required and is,
therefore, always present, but as David said, doesn't have to contain
*anything*. If it contains nothing, it's not represented an empty line.
It's just there, but not physically.

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Oct 13 '05 #27
Harrie <sp*****@linux. org.invalid> wrote:
The Document Type Declaration is part of the document, the
Document Type Definition is refered to by the former,


Nope; you have a fundamental -- but common -- misunderstandin g here;
the document type declaration subset -- the formal DTD -- is always a
syntactical part of the document, no matter if that subset is internal
or -- partly or completely -- external.

The formal public and|or system identifier are syntactically no
different from an ordinary puclic|system entity declaration and
reference in the internal subset, it's just a matter of convenience in
terms of notation.
--
Goodbye and keep cold
Oct 13 '05 #28
On Thu, 13 Oct 2005 12:22:09 -0400, Gus Richter
<gu********@net scape.net> wrote:
"HTML must have all elements closed, just as XHTML must."

The established rules for HTML clearly state that there are optional
opening/closing tags and empty elements which must not have a closing
tag. XHTML on the other hand dictates that there are no optional tags
and that all elements must be closed.
The fallacy is to equate elements and tags.

It's general practice to confuse them entirely. In this newsgroup things
are a bit better, but there's still a view that "an element is a pair of
tags". It isn't - an element is fundamentally a DOM-level notion, a tag
is a serialisation-level thing. Thinking that "elements exist in the
document" makes it hard to see how HTML elements can ever close
automatically. Thinking instead of the DOM, which obviously is a tree of
nodes (many of which are elements) and instead thinking the other way
round - asking what's the scope in the document of these element's
extents, is a much more obvious mapping.

When attending a play, one goes for the performance and not for what
goes on behind the scenes,
Whilst I don't expect an audience to understand Ionesco's clear
preference for HTML 3.1 over 4.0 when typesetting La Cantatrice Chauve,
this _is_ the sort of thing I expect from a playwright. You don't need
it to consume the product, but it does help for sophisticated levels of
authoring.
Likewise, an author creates a document according to the
established rules as set out and should not have to consider behind the
scene browser parsing methods, nor historical reasons for such rules.
This is why XML has taken off in a way that SGML never did. XML has
simple and explicit rules, which anyone can follow. Nor do you need a
DTD to be able to parse it.
In the context of the question by the OP,


Screw that. This is Usenet, this is a thread. Deal with it. The OP is a
hit-and-run one-line questioner from some dreadful web porthole. There
may be "no stupid questions", but there are certainly those that don't
go out of their way to invite a worthwhile answer. A proper Buddhist
response to such questions like "What is the essence of the Buddha's
teachings" is to hit the student firmly with a stick. We should have
more of that on Usenet.
--
Inbreeding - nature's way of always giving you enough fingers to count your cousins
Oct 13 '05 #29
David Dorward wrote:
Gus Richter wrote:

I'm not negating your points at all. I think that your points are well
made and are good to know. I do, however, think that in the context of
this discussion, a new author may be mislead or confused regarding the
differences between HTML and XHTML by the statement:

"HTML must have all elements closed, just as XHTML must."

You snipped this bit: "The difference is that SGML allows elements to be
closed by inference from the DTD and the appearance of some other
element that couldn't be contained inside the current element (implying
necessary closure) - XML however doesn't have this ability and so all
elements must be closed explicitly in the document source."

HTML must have all elements closed, but it doesn't need to have all elements
closed explicitly.


And you snipped this bit:

"The established rules for HTML clearly state that there are optional
opening/closing tags and empty elements which must not have a closing
tag. XHTML on the other hand dictates that there are no optional tags
and that all elements must be closed."

What I'm saying is that these rules are per the latest documents in
question. There is no sense in negating this and pointing out what SGML
has to say on the subject, especially if it relates to browser parsing,
which has no bearing on the subject rules of authoring for HTML 4.01 or
XHTML (whatever) and only serves to confuse the issue/question raised here.

I tried years ago to get a copy of SGML and IIRC had a devil of a time
finding the URL and once I found it, I was asked to purchase it. There
are enough people voicing their knowledge on SGML as witnessed here; as
though it really mattered. The Recommendations by themselves are written
to provide sufficient information for the author without the need to
dust off old documents such as SGML. Browser developers/programmers of
course must have access to the SGML document.

--
Gus
Oct 14 '05 #30

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

Similar topics

87
5664
by: CMAR | last post by:
For xhtml validatin, which is the right metatag to use for English language or can one forget about this tag? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> Thanks, CMA
2
2871
by: mike | last post by:
regards: I follow the following steps to converting from HTML to XHTML http://webpageworkshop.co.uk/main/xhtml_converting My parser is http://htmlparser.sourceforge.net/ Xhtml version is 1.0 from http://nds.nokia.com/uaprof/N6600r100.xml but nokia mobile browser cannot identify the converted file(XHTML1.0). Is there something wrong with my procedure.
47
10317
by: Chuck | last post by:
Is there any logical reason why one should convert if css is already being used? What possible, immediate, benefit would there be? I am at a loss to see what, pragmatic, difference it would make.
20
2584
by: Alan Silver | last post by:
Hello, I have read about the problems that IE has when using a doctype of HTML 4.01 Transitional. I was advised to use Strict wherever possible. My question is, does the same apply to XHTML 1.0 Transitional? I develop sites using ASP.NET, which emits valid XHTML 1.0 Transitional, but not XHTML 1.0 Strict (for example, it includes a hidden form field with the name of _VIEWSTATE, which isn't valid in Strict, but is in Transitional).
9
6738
by: anupamjain | last post by:
Hi, After 2 weeks of search/hit-and-trial I finally thought to revert to the group to find solution to my problem.(something I should have done much earlier) This is the deal : On a JSP page, I want to grab a URL and parse /change the HTML and send it to the JSP page. I take the URL from the user in a textbox (not the
6
7868
by: Rolf Welskes | last post by:
Hello, if I have for example: <table style="width: 100%; height: 100%;" border="1"> <tr> <td style="width: 100px">k </td> <td style="width: 100px">k </td> </tr>
10
2977
by: git | last post by:
All, I have been working on a system to support the 'tidy' program to help convert html to xhtml. The system is a little complex for me to put together as it involves apache/php/linux and a windows daemon doing the conversion, help and email systems. I would be very grateful of anyone who would be prepared to give it a quick try and see if it works for them.
14
1869
by: Stanimir Stamenkov | last post by:
I've found some contradiction I want to resolve. <http://www.w3.org/MarkUp/2004/xhtml-faq#mime11states: I've noted "_disallowed_ text/html" and "_must_ be sent with an XML-related media type" here as strong requirement. On the other hand the current XHTML 1.1 draft <http://www.w3.org/TR/2007/WD-xhtml11-20070216/conformance.html#strict>
6
433
by: Guy Macon | last post by:
cwdjrxyz wrote: HTML 5 has solved the above probem. See the following web page: HTML 5, one vocabulary, two serializations http://www.w3.org/QA/2008/01/html5-is-html-and-xml.html
11
5132
Dormilich
by: Dormilich | last post by:
Lately I have seen so much awful HTML, that I like to show what a HTML document should look like, regarding the requirements from the W3C. the absolute minimum is defined as: or expressed in code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD> <TITLE>My first HTML document</TITLE>
0
9687
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
10485
Oralloy
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...
0
10252
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
10231
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
10027
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
9073
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
6805
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
5463
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...
1
4141
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

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.