By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,978 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,978 IT Pros & Developers. It's quick & easy.

XHTML for teaching

P: n/a
I am going to teach a basic Web design course (fundamentals of HTML/CSS,
plus some basic client-side (JavaScript) and server-side (PHP, perhaps
XSLT) scripting). Most of the students do not have any previous knowledge
of all of this.

I am strongly considering teaching XHTML 1.0 Strict instead of HTML 4.01
strict, for the following reasons:
- XML syntax is far more simple to teach than HTML/SGML, simply because
there are not as many exceptions and subtleties.
- The stricter the language is, the stricter they are compelled to be
when writing webpages.
- It will be easier to use XSLT if they only know about XML and if they
remain the whole time in an XML world.
- They will have some other courses where XML is used, so that they
should be in familiar territory.
- XML is the future (rather lame argument, I know, but one I believe in
;-).

They would be required to validate all their webpages, obviously, so that
it will not be tag soup. Webpages would be served as text/html for IE
support (or I might try to install some content negociation mechanism)
and I would talk about respecting Appendix C compatibility rules (by the
way, is there an on-line tool for checking conformity with these?).

One of the major drawback I see is the obligation to remove the XML
prolog, to be sure IE is in strict mode for CSS, and therefore to make
sure that all webpages are in UTF-8.

Does anybody see any other reason not to use XHTML in this very specific
context?

--
Pierre Senellart
Sep 18 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
Pierre Senellart <in*****@invalid.org> wrote:
Does anybody see any other reason not to use XHTML in this very specific
context?


There's nothing specific about your context.

Check out the current thread "XHTML 1.0 / 1.1 / 2.0" in this group, and
http://www.spartanicus.utvinternet.ie/no-xhtml.htm

--
Spartanicus
Sep 18 '05 #2

P: n/a
Spartanicus ,comp.infosystems.www.authoring.html:
Does anybody see any other reason not to use XHTML in this very specific
context?
There's nothing specific about your context.


Yes, there is. I provided a number of arguments in favor of XHTML in this
specific context. The main one is that it is much easier for
students to learn XML syntax than HTML syntax (all the more since the
HTML dialect that user agents understand is not formally described by
anything, and is definitely not described by SGML rules). The more
simple, the better.
Check out the current thread "XHTML 1.0 / 1.1 / 2.0" in this group, and
http://www.spartanicus.utvinternet.ie/no-xhtml.htm
I am familiar with these arguments, but I am still not convinced in
contrast with the arguments in my original message.

In particular:
# It's stricter.
There's nothing to stop an author from applying the same "strictness"
to HTML. This is purely down to the author, it doesn't need a stricter
DTD. You prefer having closing paragraph tags? What's stopping you from
using them? They are valid under HTML. For those that like the idea
that validation warns them if they for example forget to close a
paragraph element, it's not difficult to validate using a custom HTML
DTD that is as strict as the XHTML DTD. A short guide to validating
against a custom DTD.


I definitely do not want to make them validate against a cutom SGML DTD
they (and I, for that matter!) will not understand anything of.
Sep 18 '05 #3

P: n/a
In article <dg***********@nef.ens.fr>,
Pierre Senellart <in*****@invalid.org> wrote:
I am going to teach a basic Web design course (fundamentals of HTML/CSS,
plus some basic client-side (JavaScript)
Client-side JS interacts differently with application/xhtml+xml and
text/html.
I am strongly considering teaching XHTML 1.0 Strict instead of HTML 4.01
strict, for the following reasons:
- XML syntax is far more simple to teach than HTML/SGML, simply because
there are not as many exceptions and subtleties.
But if they send it as text/html, the subtleties are worse than learning
HTML.
- It will be easier to use XSLT if they only know about XML and if they
remain the whole time in an XML world.
TSaxon: http://mercury.ccil.org/~cowan/XML/tagsoup/tsaxon/
and I would talk about respecting Appendix C compatibility rules (by the
way, is there an on-line tool for checking conformity with these?).
http://qa-dev.w3.org/~bjoern/appendix-c/validator/
I don't know if it really works.
therefore to make
sure that all webpages are in UTF-8.
Using UTF-8 is the best practice that should be taught anyway.
Does anybody see any other reason not to use XHTML in this very specific
context?


The issues related to Appendix C are likely more confusing that HTML.
See also: http://www.hixie.ch/advocacy/xhtml

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Sep 18 '05 #4

P: n/a


Pierre Senellart wrote:
I am going to teach a basic Web design course (fundamentals of HTML/CSS,
plus some basic client-side (JavaScript) and server-side (PHP, perhaps
XSLT) scripting). Most of the students do not have any previous knowledge
of all of this.

I am strongly considering teaching XHTML 1.0 Strict instead of HTML 4.01
strict, for the following reasons:
- XML syntax is far more simple to teach than HTML/SGML, simply because
there are not as many exceptions and subtleties.
- The stricter the language is, the stricter they are compelled to be
when writing webpages.
- It will be easier to use XSLT if they only know about XML and if they
remain the whole time in an XML world. They would be required to validate all their webpages, obviously, so that
it will not be tag soup. Webpages would be served as text/html for IE
support (or I might try to install some content negociation mechanism)
and I would talk about respecting Appendix C compatibility rules


But with XHTML served as text/html and all those compatibility rules the
trouble starts:

- For instance you say you want them to use XML all the time and then
XSLT too. Have you considered how you get the XSLT processor then to
transform to XHTML that follows the compatibility rules? XSLT 1.0 as
specified by the W3C has no support for that, it has output methods
text, xml, and html where the last is suitable for HTML (4) output and
where the xml output method is simply a general XML output method that
has no clue about any XHTML as text/html compatibility rules. So to
generate XHTML with XSLT 1.0 you can of course use the xml method but
whether an empty element like br is then serialized as
<br></br>
or
<br/>
or
<br />
is not something you could configure with most XSLT processors. And to
be compliant with the compatibility rules you would need to enforce
<br />
There are some XSLT processor which provide an additional output method
xhtml, there are XSLT processor where you can, depending on your
programming skills, write your own serializer and plug that in to make
sure you get XHTML complying with the compatibility rules but of course
all that is becoming processor dependent then.

- For basic client-side scripting you would probably use document.write
then for instance but in your XHTML documents treated as text/xml or
application/xml or application/xhtml+xml the method is not working. And
that is only one example for client-side scripting where your
expectation "XML syntax is far more simple to teach than HTML/SGML,
simply because there are not as many exceptions and subtleties." blows
up because you need to fullfill not only XML syntax but SGML syntax too
(Appendix C compatibility) and deal with all those exceptions and
subtleties that treating your documents as both text/html and
application/xhtml+xml introduces.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 18 '05 #5

P: n/a
Pierre Senellart wrote:
Yes, there is. I provided a number of arguments in favor of XHTML in this
specific context. The main one is that it is much easier for
students to learn XML syntax than HTML syntax (all the more since the
HTML dialect that user agents understand is not formally described by
anything, and is definitely not described by SGML rules).


Whereas XHTML is supported by very few user agents but it often served as
text/html in which case it is handled by those same HTML dialect rules you
mentioned.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Sep 18 '05 #6

P: n/a
Henri Sivonen ,comp.infosystems.www.authoring.html:
Client-side JS interacts differently with application/xhtml+xml and
text/html.
I thought the differences were quite minor, but after reading
http://www.hixie.ch/advocacy/xhtml I saw it was a bit more complex.
You have a point here.
TSaxon: http://mercury.ccil.org/~cowan/XML/tagsoup/tsaxon/
Yes, Gnome's libxslt also does this kind of thing (XSLT on HTML
documents), but it is still something I use only when I don't have the
choice.
http://qa-dev.w3.org/~bjoern/appendix-c/validator/
I don't know if it really works.


Thanks, I'll have a look.

Thanks for the other comments too, I am still pondering it.
Sep 18 '05 #7

P: n/a

Pierre Senellart wrote:
I am strongly considering teaching XHTML 1.0 Strict ....One of the major drawback I see is the obligation to remove the XML
prolog, to be sure IE is in strict mode for CSS, and therefore to make
sure that all webpages are in UTF-8.


Or US-ASCII. :) We members of the ASCII Preservation Society wouldn't
want you to teach your students that the new-fangled eye-candy Johnny-
come-lately bloatware UTF-8 is the *only* choice. What if we run into
a bit shortage and can no longer afford a whole 8 bits per character?
:) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :)

--
Guy Macon <http://www.guymacon.com/>
Sep 18 '05 #8

P: n/a
On Sun, 18 Sep 2005, Guy Macon wrote:
Or US-ASCII. :) We members of the ASCII Preservation Society
wouldn't want you to teach your students that the new-fangled
eye-candy Johnny- come-lately bloatware UTF-8 is the *only* choice.


Bzzzzt! US-ASCII *is* utf-8. Or, at least, a subset of it.

SCNR.
Sep 18 '05 #9

P: n/a

Alan J. Flavell wrote:

On Sun, 18 Sep 2005, Guy Macon wrote:
Or US-ASCII. :) We members of the ASCII Preservation Society
wouldn't want you to teach your students that the new-fangled
eye-candy Johnny- come-lately bloatware UTF-8 is the *only* choice.


Bzzzzt! US-ASCII *is* utf-8. Or, at least, a subset of it.


Right, but there are occasions where you have to choose between
encoding="utf-8" and encoding="US-ASCII" or between charset=utf-8
and charset=US-ASCII... A true ASCIIphile such as myself will
always explicitly specify the subset. There is no good technical
reason to do so, but it is well known that ASCII makes one much more
attractive to members of one's preffered gender... :)
Sep 18 '05 #10

P: n/a
Pierre Senellart <in*****@invalid.org> wrote:
http://www.spartanicus.utvinternet.ie/no-xhtml.htm


I am familiar with these arguments, but I am still not convinced in
contrast with the arguments in my original message.

In particular:
# It's stricter.
There's nothing to stop an author from applying the same "strictness"
to HTML. This is purely down to the author, it doesn't need a stricter
DTD. You prefer having closing paragraph tags? What's stopping you from
using them? They are valid under HTML. For those that like the idea
that validation warns them if they for example forget to close a
paragraph element, it's not difficult to validate using a custom HTML
DTD that is as strict as the XHTML DTD. A short guide to validating
against a custom DTD.


I definitely do not want to make them validate against a cutom SGML DTD
they (and I, for that matter!) will not understand anything of.


I fail to understand why so many people latch on to the bit on the use
of a Custom HTML DTD as a reason not to use HTML, I'll repeat the real
argument:

Myth: XHTML is stricter.
Answer: There's nothing to stop an author from applying the same
"strictness" to HTML. This is purely down to the author, it doesn't need
a stricter DTD. You prefer having closing paragraph tags? What's
stopping you from using them? They are valid under HTML.

If you want to teach your students to use a validator and you are
worried that they will not for example close paragraph elements despite
the fact that you've taught them to do so, then that forms an argument
for reviewing your teaching methods because you are not getting through
to them. If that doesn't help then IIRC there are validators that can
point out such things without the use of a custom DTD. IIRC Nick Kew's
Page Valet has an option that does that.

--
Spartanicus
Sep 18 '05 #11

P: n/a
On Sun, 18 Sep 2005 10:55:00 +0000 (UTC), Pierre Senellart
<in*****@invalid.org> wrote:
I am strongly considering teaching XHTML 1.0 Strict instead of HTML 4.01
strict, for the following reasons:


CIW does this, but does it very badly. They teach XHTML as "HTML 5" and
make _no_ reference to non-XML HTML. This leaves their students perhaps
capable of building sites in isolation but it leaves them ill-equipped
to take up any "web development" job and worst of all it's thoroughly
misleading in teaching them that this is how the world is, when it so
clearly isn't.

By all means teach XHTML 1.0 to your students. The reasons you give are
good ones. But if you do so, _please_ also teach:

- Appendix C, and the very real constraints on why you still can't
serve XHTMl as XML all the way across the web.

- The history of HTML / SGML, why they're only learning a partial slice
of it, and what else they'd need to learn to understand HTML 4.01

- The real-world constraints of where their XHTML approach will fail,
such as users, external CMS, users, MS Word, users, or external ad
servers.
Personally I think all this is not a good idea, although not a
desperately bad idea. Teach them valid HTML 4.01 and encourage an
XML-like coding style. Also teach them that XML exists, is different,
and teach them about the real ugliness of tag soup which is what they're
going to encounter.

You can't teach them everything, as you're starting at a very low level.
But teaching them the basics of the real world and the existence of the
XML world seems like a better preparation for the web than the basics of
XML and the existence of the soup route.
--
Cats have nine lives, which is why they rarely post to Usenet.
Sep 18 '05 #12

P: n/a
On Sun, 18 Sep 2005, Pierre Senellart wrote:
One of the major drawback I see is the obligation to remove the XML
prolog, to be sure IE is in strict mode for CSS, and therefore to make
sure that all webpages are in UTF-8.


Your conclusion is wrong: Of course, you can and should define
an encoding (charset) in the HTTP header. This encoding can be
anything - not just UTF-8.
http://www.w3.org/International/O-HTTP-charset.html

(But I see nothing wrong with UTF-8 today. Even Netscape 4.0
knows UTF-8.)

Sep 19 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.