Click to See Complete Forum and Search --> : the dreaded W3C specs...
Da Warriah
07-27-2003, 07:50 PM
hehe, sometimes i think i should make a movie about people getting haunted and having to read W3C specs, over and over and over, until they die of not being able to understand it...hehe...
actually the point of this thread is that i took the time to read through the XHTML 1.0 specs (http://www.w3.org/TR/xhtml1/)...not quite as cryptic as some of them out there, but i still had a few things that i didnt quite understand, possibly from a lack of total understanding, or because of the way it was worded...who knows...but i was wondering if anyone could shed some light on some of these questions...thanx:D
An XML declaration is not required in all XML documents; however XHTML document authors are strongly encouraged to use XML declarations in all their documents. Such a declaration is required when the character encoding of the document is other than the default UTF-8 or UTF-16 and no encoding was determined by a higher-level protocol.
ive never really learned anything about UTF-8 or UTF-16, but is that not the character sets that the page uses? i have a meta tag on my page:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
however this isnt "UTF-8 or UTF-16", so should i place an XML declaration on my document?
next on my list of questions: it states about the deprecation of the name attribute and that id should now be used...does that mean that in any javascript where you want to target a certain form/other object, you need to use getElementById, considering that you now dont have a name attribute to target it by? and for PHP $_POST variables, how do you now get the value of a certain form object without its name attribute?
also for the XHTML special characters, it lists that &lt; is now &#38;#60; (two separate ways? or one?) and that &gt; is now &#62;...does this mean that we should change them all over from &gt; to &#62; or is it simply saying that both will now work?
Don't include more than one isindex element in the document head. The isindex element is deprecated in favor of the input element.
what is the isindex element?
In tables, the tbody element will be inferred by the parser of an HTML user agent, but not by the parser of an XML user agent. Therefore you should always explicitly add a tbody element if it is referred to in a CSS selector.
so i should now always put a <tbody> tag in my tables?
sorry for the long post, but thanx for any replies you have to this...;)
boojum
07-28-2003, 01:45 AM
charswet/xml declaration: that is not refering to the meta tag. the meta tag is the way to go for charset declarations because internet explorer (up to the latest, ie6sp1) doesnt recognize the doctype if you put in the xml declaration (im told). utf-8 is default so declaring it is not necissary.
http://www.w3.org/TR/html4/sgml/entities.html
i know its an html reference, but xhtml uses this for its charset issues.
i dont know about *need* (except in strict and 1.1), but do use the id att. use getElementById for javascript, i dont know about php. use the id attribute except in forms, as name is still all that works in forms-- that is *in* forms, the form itself can use id. and by 'in forms' i mean form elements, an img (for example) in a form can still use id.
38 is an amperstand so that must have been a mistake (probably included it in the pre). i dont believe, but am not absolutely certain, that there has been a change to lt and gt
isindex=
http://www.w3.org/TR/html4/interact/forms.html#edef-ISINDEX
basicly a crap precursor(?) of input
if you have a style declaration in css that specificly refers to a tbody element (as in tbody{}) then you must have a tbody somewhere in the html. remember that if you have a tbody or thead or tfoot, you must have the other two as well. they can be empty (i know that an empty td in a tr is fine, im not sure about just plain empty though)
Charles
07-28-2003, 02:14 AM
XHTML isn't just for browsers so some of the rules are going to seem a little strange. Myself, I only really use it in conjunction with an XSLT processor.
1) MSIE has a querks mode and a standards mode and if you use the XML declaration in the prolog then it will go into querks mode. So you will want to avoid its use if you are publishing the XHTML on the web. But don't worry, utf-8 is a superset of iso-8859-1. You should, however, change your META element to indicate utf-8.
2) You can just pretend that the IDs are NAMEs. That's why if you use both you must be sure that for any element the NAME and ID are the same.
3) From the XHTML 1.0 Specification (http://www.w3.org/TR/xhtml1/#h-A2)The XHTML entity sets are the same as for HTML 4, but have been modified to be valid XML 1.0 entity declarations. Note the entity for the Euro currency sign (&euro; or &#8364; or &#x20AC;) is defined as part of the special characters. Go ahead and use the entities as you have been accustomed.
4) See http://www.w3.org/TR/html4/interact/forms.html#edef-ISINDEX.
5) HTML has a lot of optional tags for elements but in XHTML all tags are required. You will have to give all TABLEs a TBODY.
Da Warriah
07-28-2003, 09:01 AM
Originally posted by Charles
You should, however, change your META element to indicate utf-8.
so how do i go about doing that...something like this instead?
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
2) You can just pretend that the IDs are NAMEs. That's why if you use both you must be sure that for any element the NAME and ID are the same.
but still, how would that work for something like an input tag? would i have to use id="input" name="input" in order to use the value in something like a PHP validator?
5) HTML has a lot of optional tags for elements but in XHTML all tags are required. You will have to give all TABLEs a TBODY.
alright, so i add a TBODY to tables...
remember that if you have a tbody or thead or tfoot, you must have the other two as well.
now that i added a TBODY, i now have to add a THEAD and a TFOOT as well?
and OOOONNNNEEE last question to bug you guys with...i know tables are not supposed to be used for layout...and im working on changing my websites to suit that...but charles, youve also said here (in the forums) that tables arent to be used for "presentation"...so then, what ARE they to be used for? if i have an image on the left and a description on the right, and theres ten images down in a list, would that be a valid use for a table? or should i make my life more difficult with div's that act on their own accord?
boojum
07-28-2003, 10:29 AM
exactly
i dont know about php, but an id is unique so if you have an input element with id='input' it must be the only one
as far as i can tell, both charles and i are wrong about tbody. from the html4.01 spec:
"The TBODY start tag is always required except when the table contains only one table body and no table head or foot sections."
from
http://www.w3.org/TR/html4/struct/tables.html#h-11.2.3
so tbody is required except in the common case that there is only one tbody. my statement, about requiring all if any is present, was either a confusion of the latter part of the spec's sentence or was some informal recommendation somewhere else that i remembered as a formal/spec recommendation
tables are like any other tag, there is a specific, logical, intended use. an img tag is for images (which is the easiest of course), a p is for a paragraph even though it is often rendered the same as inline text with a single br. so on for the other tags including table, which is for tabular data.
http://dictionary.reference.com/search?q=tabular
tabular is a logical concept independant of implementation. it can be viewed/digested in any way but the data is always logicaly tablular. i find the best way, to determine if something is tabular, is to try to describe it using the elements of a table. if it makes sense to be described using the terms row, column, group, head, then it is most likely tabular. if it isnt made up of some of those four things, and it is easy to describe it using the terms alignment or spacing, then it is a positional not tabular concept
nkaisare
07-28-2003, 10:50 AM
Originally posted by Da Warriah
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
I'd personally do that. I won't include the XML declaration at the top to avoid IE6 going into quirks more.
but still, how would that work for something like an input tag?
You may continue to use name attribute for form elements (such as input element). I believe id attribute will not be necessary in this case.
alright, so i add a TBODY to tables...
My interpretation was different from Charles': tbody is not required.
now that i added a TBODY, i now have to add a THEAD and a TFOOT as well?
EDIT: I am not sure anymore. I think you can have tbody without thead or tfoot.
what ARE they(tables) to be used for?
For tabular data. Most of the times, what constitutes tabular data is clear. At times, it isn't. Use your descretion.
if i have an image on the left and a description on the right...
To me, that can be considered a valid use of tables. You are using tables to imply relationship between the image and its description. It fits tabular data definition (due to lack of <caption> element for <img>).I'd also recommend using <tbody>, <thead> and <tfoot> for this example (although personally I don't use them to save space :)).
Note: Take things from me with a pinch of salt. I just had a cursory glance at XHTML 1.1, not read it thoroughly.
Da Warriah
07-28-2003, 12:43 PM
alright, thanx everyone, i understand this stuff now, hehe...:D