Click to See Complete Forum and Search --> : Are you XHTML compliant?
pohopo
07-07-2006, 08:20 PM
I just made a mental decision to start coding using the XHTML standard. I was reading the changes and I really like how the name attribute is going away!
So anyone else make the jump? It is not really all that much in extra coding and I like the improved logic of it all.
Jason Batten
07-07-2006, 09:12 PM
<br /> or <br> is the question!
<br /> looks like it means: line break here, no wait a second scrap that idea
halojoy
07-07-2006, 09:16 PM
XHTML
so,
what is the major differences when writing XHTML standard
compared to HTML
you can list some?
bpat1434
07-07-2006, 11:14 PM
It's the next version.... is that good enough? Kind of like coding for PHP 5 now... knowing that PHP 4 is on the way out.
XHTML is a stricter and cleaner version of HTML.
The Most Important Differences:
* XHTML elements must be properly nested
* XHTML documents must be well-formed
* Tag names must be in lowercase
* All XHTML elements must be closed
Today's market consists of different browser technologies, some browsers run Internet on computers, and some browsers run Internet on mobile phones and hand helds. The last-mentioned do not have the resources or power to interpret a "bad" markup language.
Therefore - by combining HTML and XML, and their strengths, we got a markup language that is useful now and in the future - XHTML.
But before I plagarize the entire site... just go to www.w3schools.com and read up on the XHTML information.... the first like 4 pages are why xhtml, html vs xhtml, and where it comes from.
Honestly: Any standarsd website is a good site. It's the easiest way to ensure that your site looks as it should on almost every browser ;)
phpshift
07-08-2006, 12:00 AM
I am confused about the name attribute going away, as it is needed in order to identify form fields with PHP.
bpat1434
07-08-2006, 12:13 AM
I guess that the id will work just like name did.....
The id Attribute Replaces The name Attribute
Which would be a good guess....
phpshift
07-08-2006, 12:15 AM
Well, I've tried using ID to catch form input, but it doesn't work. Do you have to have one of the DTD header things that xhtml uses in order for it to catch it?
bradgrafelman
07-08-2006, 12:17 AM
If you're trying it in IE, you might need to use JS' getElementById() function.
bpat1434
07-08-2006, 12:18 AM
Have no idea... but it's not valid XHTML if there's no DTD.... so I guess yes!!
Of course, HTML is still there, and XHTML isn't completly replacing HTML now... so the name attribute, although deprecated, is still "valid".
phpshift
07-08-2006, 12:21 AM
Yes, but valid or not for HTML or XHTML, will the change to XHTML and the deprecation of the name attribute effect PHP's form processing?
bpat1434
07-08-2006, 12:22 AM
Yes, but I think PHP will catch this in the next version. But obviously we have nothing to worry about.... HTML 3.0 is still in use in some web pages.....
phpshift
07-08-2006, 12:26 AM
I think they should just leave the name attribute alone. It's not causing any trouble, but taking it out will. Besides, some hosts don't update PHP as often as they should. Any members of that host would have to wait until the new ersion of PHP was installed. Until then, their forms might be completely useless.
bradgrafelman
07-08-2006, 12:29 AM
While I don't know the reasoning for moving away from the NAME attribute, people should still be open to the concept of change.
As my old Resource Management teacher said, you can do three things about change: Accept it, Reject it, or Ignore it.
Weedpacket
07-08-2006, 12:58 AM
No, this has been discussed before (http://www.phpbuilder.com/board/showthread.php?t=10296318) and is the result of a misinterpretation of the standard. The name attribute for form fields is not going away (just look at the XHTML 1 Strict DTD (http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd) if you don't believe me).
shonuff
07-08-2006, 01:26 AM
Weedpacket's right, the name attribute is perfectly valid for forms. The name attribute that is deprecated is the name attribute used on elements other than form controls. For instance, links...
This:
<a href="#Link">Link to some point on the page</a>
<a name="Link">This is the Link</a>
According to XHTML 1.0 Strict should be:
<a href="#Link">Link to some point on the page</a>
<a id="Link">This is the Link</a>
Using the name attribute on form controls is still valid even in XHTML Strict.
pohopo
07-08-2006, 01:36 AM
My mistake. I misread the article which I will paste below
HTML 4 defined the name attribute for the elements a, applet, form, frame, iframe, img, and map. HTML 4 also introduced the id attribute. Both of these attributes are designed to be used as fragment identifiers.
In XML, fragment identifiers are of type ID, and there can only be a single attribute of type ID per element. Therefore, in XHTML 1.0 the id attribute is defined to be of type ID. In order to ensure that XHTML 1.0 documents are well-structured XML documents, XHTML 1.0 documents MUST use the id attribute when defining fragment identifiers on the elements listed above. See the HTML Compatibility Guidelines for information on ensuring such anchors are backward compatible when serving XHTML documents as media type text/html.
Note that in XHTML 1.0, the name attribute of these elements is formally deprecated, and will be removed in a subsequent version of XHTML.
Name is still with us. Though I still think their should just be one attribute to identify a tag.
Weedpacket
07-08-2006, 03:02 AM
Name is still with us. Though I still think their should just be one attribute to identify a tag.(Assuming that by "tag" you mean "element".) How would you identify radio buttons? It makes perfect sense to have one attribute to name a form field, and a different attribute to identify an XHTML element.
pohopo
07-08-2006, 01:48 PM
(Assuming that by "tag" you mean "element".) How would you identify radio buttons? It makes perfect sense to have one attribute to name a form field, and a different attribute to identify an XHTML element.Okay, After some googling to try to prove my point I have come to the conclusion that I am wrong and weedpacket is right. In my own, sometimes twisted, brain the name attribute was more then it was in real life.
Thanks for the clarification!
halojoy
07-11-2006, 11:03 AM
I just made a mental decision to start coding using the XHTML standard. I was reading the changes and I really like how the name attribute is going away!
So anyone else make the jump? It is not really all that much in extra coding and I like the improved logic of it all.
I am writing a PHP CMS Application now.
I wanted to have Valid CSS and Valid HTML 4.01.
And so I made it VALID.
It is not very difficult, if you use the Errors and Comments
at
http://jigsaw.w3.org/css-validator/ and http://validator.w3.org/
Just to see how a XHTML 1.0 check would turn out, I ran a test.
There were many errors, but like 90% were: <br /> tag.
Looks like <img> and <br> should be <img /> and <br />
and same goes for META tags in head.
Now I have corrected my CMS Script to be: Valid XHTML 1.0 Transitional
You can find DEMO here: http://okay.mine.nu/pub2/cmsdemo/
Remember, my script is Under Construction.
I will be adding the ADMIN with page editor now.
:)
Shrike
07-11-2006, 08:37 PM
In my opinion XHTML has become a fashionable thing to do without any real reason behind it. Alot of the time I see XHTML documents which could be written more easily (and validated) in HTML transitional. I've not often seen XHTML used for it's intended purpose - that is with an eXtended element list, or for delivery to different devices. I just can't see the point of writing XHTML documents which look and work just like HTML documents. XHTML certainly is a superior language which seems to be misused.
madwormer2
07-11-2006, 09:20 PM
I suppose some people are seeing it as something that if they do it now, they won't have to go back and re-do it in the future.
But hey, I do it coz the X makes it sound that much cooler!
Apparently they're also teaching XHTML in schools, instead of HTML. Those are the schools that teach that stuff. Damned boarding school. Just 'coz ya Daddy's rich :rolleyes:
Elizabeth
07-11-2006, 09:47 PM
...I have come to the conclusion that I am wrong and weedpacket is right.
Don't feel bad, pohopo, I came to that conclusion (about myself, not you) a long time ago. :)
madwormer2
07-11-2006, 09:51 PM
XHTML people! Spread the word!
Lol.
I just thought, maybe it gains us extra exp. if we use Xhtml? :D*++
Weedpacket
07-12-2006, 04:31 AM
that is with an eXtended element listYou mean embedding material from foreign namespaces? Does IE even do that? (I know Firefox does, at least for SVG and MathML).or for delivery to different devices.Well, HTML was designed for that as well.
Really, XHTML is just a simplified version of HTML. In fact, that's literally how the XHTML standard presents it: "You know HTML 4.01? XHTML is just like that only you can't do these things:..." and then proceeds to list all the bits of HTML that break the XML standard.
Why bother deliberately dumbing down to HTML Transitional when valid XHTML Transitional validates as HTML Transitional anyway? Or do you prefer HTML just because it is sloppier? :D
Shrike
07-12-2006, 06:11 AM
You mean embedding material from foreign namespaces? Does IE even do that? (I know Firefox does, at least for SVG and MathML).
It doesn't just have to be browser based stuff. You can import and manipulate custom XHTML elements in SimpleXML/DOM and so forth just because it's valid XML. I am experimenting with a little database reporting tool which uses XHTML documents loaded into SimpleXML. The custom tags are of the format
<cttreport type="html" paged="yes">
<cttreportrow rollupat="5">
<cttreportcell style="somestyle" colspan="2"><cttreportvalue name="foovalue" /></cttreportcell>
</cttreportrow>
</cttreport>
The idea being PHP reformats the custom tags and attributes (but leaves the standard ones alone) and then you can simply print the finished document straight to the browser as it's XHTML. It's a nice approach but definitely a work in progress :)
Or do you prefer HTML just because it is sloppier? :D
Yes, I do in a way. Simper is better in many circumstances.
Weedpacket
07-12-2006, 07:12 AM
You can import and manipulate custom XHTML elements in SimpleXML/DOM and so forth just because it's valid XML.I'm messing around with stuff like that as well; but no-one will see the stuff from the imported namespace (with the appropriate DTD etc. otherwise it wouldn't be valid) because (a) it would have been transformed away before being sent to them, and (b) they wouldn't know what to do with it if they got it. In fact, it might as well be any sort of XML that is getting transformed, and it's the XHTML namespace that's being imported for purposes of specifying web browser markup. But the web browser would still be getting XHTML.
Heehee, he said "simper" ... that brings up mental images I didn't need.
Well, like I said, XHTML is simpler than HTML. Especially when it comes to generation and parsing.
Shrike
07-12-2006, 07:37 AM
Heehee, he said "simper" ... that brings up mental images I didn't need.
Oh crap I previewed that post and everything ;)
It could be any old XML input, but having one document in and the same document out makes things simper...err :p
dream.scape
07-13-2006, 12:47 AM
I can't believe this conversation is taking place today. You guys missed the party and argument on if one should use XHTML or not by a long shot.
Jason Batten
07-13-2006, 01:33 AM
XHTML, no way! HTML5 DUDES!!!
`~!@#$%^&*() _+-{}[]||\:";'<>?/., <<< VALID via COPY unt PASTE`
JASON-l337-SCRIPT:
<web page>
<column one><magic menu>
<column two><content>
<column three><ads>
<noob tracker>
THEN, it SCANS your MIND MAN! via webcam and you get a web site according to YOUR mind, HOW SWEET is this stuff DUDE... man... noobx3r
YOs Dawgs should be CRACKING the HCP - HTML CSS PHP - its THE NEW web 1.33.7
<? mission complete %>
Shrike
07-13-2006, 04:05 AM
I can't believe this conversation is taking place today. You guys missed the party and argument on if one should use XHTML or not by a long shot.
What are you surprised about? The thread poses a pretty fair question, much like the PHP 4 or PHP 5 debate.
dream.scape
07-13-2006, 04:29 AM
What are you surprised about?
That you're just now debating it. That boat sailed a few years ago.
Really the only XHTML debates that happen any more, which isn't even that often, are whether to use XHTML Transitional or XHTML Strict.
Personally, I haven't even thought about using or cared about HTML 4 for at least 3 or 4 years, just like I've stopped caring about NS 4 or IE 3 (and IE 5.0 to an extent).
It's not like XHTML is some cutting edge thing that just showed up yesterday. It's been widely used and deployed for a number of years. When you code a stylesheet, do you still only use CSS1? I doubt it.
And it's nothing like the PHP 4 or PHP 5 debate. It's not like developers making browsers must decide if they're going to support HTML 4 or XHTML. They did have to decide when they were going to add XHTML support in addition to HTML 4 support, but that decision has been long made.
Shrike
07-13-2006, 05:13 AM
What makes you think that we are 'just now' debating it? It has been a topic on the board since it's inception
It's not like XHTML is some cutting edge thing that just showed up yesterday. It's been widely used and deployed for a number of years.
That's not a reason to stop talking about it. XHTML 2.0 is still undergoing review afaik. As Weedpacket pointed out, XHTML itself is still not properly supported, just like CSS 2 and 3. I made the comparison with PHP since PHP 5 has been around for a few years now and still doesn't have the same usage as PHP 4, particularly in the shared host market. The same can be said for XHTML.
PHP Builder
Copyright Internet.com Inc. All Rights Reserved.