|
Posted by Jeff on 10/01/10 12:01
cwdjrxyz wrote:
> On Jan 28, 1:02 am, cwdjrxyz <spamtr...@cwdjr.info> wrote:
>> On Jan 27, 5:41 pm, A-OK-SITE <aoksi...@gmail.com> wrote:
>>
>>
>>
>>> On Jan 27, 3:46 pm, "Jukka K. Korpela" <jkorp...@cs.tut.fi> wrote:
>>>> Scripsit Jeff:
>>>>> I have a bit of javascript that I'd like to hide from the validator.
>>>> Consider learning what a validator is before trying to fool it.
>>>> Then read the validator's FAQ list when you run into problems.
>>>> And if you use JavaScript, just put any bulky code into an external
>>>> file, and any validation issues with it vanish in a puff of logic.
>>>>> Should I be using XHTML [...]?
>>>> No, especially since you asked.
>>>> --
>>>> Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
>>> Jeff,
>>> Everybody seems to have a preference as to which doc type they prefer
>>> html or xhtml and most of it has no basis in reality. It is like the
>>> old Ford vs Chevy argument in which both are good but for some reason
>>> people just seem to like one more than the other.
>>> XHTML is a cleaner code with features like self-closing tags (et al).
>>> The XHTML is almost always served and interpreted as HTML with the
>>> main difference being the syntax only. The new HTML 5.0 and XHTML 2.0
>>> that is soon to be released is bringing the two types even closer
>>> together based on preliminary information. It is also somewhat like
>>> the difference between strict and transitional and both will render
>>> the page the same with only minute differences in the way the page is
>>> coded.
>>> So in summary pick the language you feel the most comfortable with and
>>> use it. They are both valid and fully functional, and all modern
>>> browsers will render the code just fine. It is just my humble opinion
>>> but I prefer XHTML, but I always preferred a Chevy and a Budweiser
>>> too.
>> Unfortunately no IE browser, including IE7, can render any xhtml if it
>> is served properly as mime type application/xhtml+xml. All you get is
>> an error message. Many mis-serve xhtml as text/html and use an
>> extension .html. Although this often works for IE browsers, there is
>> no point in writing xhtml code in the first place if you are not going
>> to serve it as xhtml. Since the extension .html usually is associated
>> with the mime type for text/html on the server, you have to use
>> another extension, such as .xhtml, and assign it to the xhtml mime
>> type application/xhtml+xml on the server. Then when you serve xhtml
>> properly, in addition to IE browsers not working, other modern
>> browsers such as Firefox, Opera, Seamonkey, and Safari for Windows
>> will handle true xhtml. However then the code is parsed as xml. A xml
>> parser must be much more strict than a html parser. The least little
>> mistake, such as a single unclosed tag, gives a fatal parse error that
>> results in an error message rather than a view of the page, which
>> often works with little problem in html.
>>
>> If you want to serve true xhtml, you have to provide IE html by using
>> separate pages, header/browser exchange and rewriting the page for
>> html for browsers that do not indicate they can handle the mime type
>> for xhtml, etc. The main reason for all of this trouble is that
>> Microsoft can not or will not write their browsers to handle modern
>> xhtml properly. Hopefully, now that Vista is out after much delay,
>> Microsoft will have time to bring their browser up to date. IE7 was
>> just a minor change from IE6. It did correct some bugs and might be a
>> bit more secure. However it was outmoded at the moment it was
>> released.
>>
>> The important thing to remember is that you have xhtml only if both
>> the code is written in xhtml and it is served as application/xhtml+xml
>> - not text/html. The W3C validator only validates the code as html or
>> xhtml. It does not validate that the code is being served properly.
>> However, in the most detailed setting of the validator, it will tell
>> you if the page is being served as text/html or application/xhtml+xml.
>> You will find very few pages being served properly as xhtml when you
>> check them.
>
> A web page written and served properly as xhtml can be all html, all
> xml, or a combination of both. When a page is written in xhtml that
> includes only code that is part of html, then of course it serves no
> useful purpose to write it in xhtml instead of html, but it also does
> no harm if you know xhtml well and are properly set up to serve it.
> However if the page includes some xml, then you have to use xhtml,
> unless you can use some tricks to make the xml part show up. PCs are
> now just a small part of the many computer devices out there. Many of
> the modern small and portable devices are xml devices.
Now that is something I'm interested in.
I had thought that since everything is CMS driven that I can just
create something like an RSS feed, that would have a bit of html in it
(like "strong" or "i" or br) and serve that depending on accept type.
Now, it's not hard to generate well formed RSS but those html strays
in there are another story. Will those bits then also have to be in
correct xhtml? In other words: <br> or <br />?
Jeff
Many pages will
> work properly on small xml devices if properly written in xhtml. An
> xhtml page requires parsing as the very strict xml, because it may
> contain some xml. Devices that are xml do not allow many errors that
> an html device will tolerate. One of the most serious errors you can
> make in xml is to not close something that should be closed, for
> example. Some think of xhtml as a transition language, and that in the
> future all code will be in a language that is closer to xml than html.
> I am not a prophet, and time will tell.
Navigation:
[Reply to this message]
|