Forum Moderators: open
I was surprised to discover that when saved from FF2, FF removed the closing slashes before saving the file!
So I opened up IE6 and saved the file from it. It removed the slashes, capitalized all of the element names, and changed the doctype to transitional. It also used the page title with an extension htm for a filename instead of the document's filename with its html extension.
WHAT the heck is up with all that?!?
Bear in mind that, whichever syntax you have chosen, than technically-speaking the trailing slashes are treated as coding errors by the browser when serving the file as
text/html. Firefox in particular does some error-correction when saving the parsed file, so you are possibly seeing the result of the corrected source code. <added> Testing a simple XHTML page in Firefox, I can see that the saved file represents the page after parsing and error-correction - the slashes are dropped as the file is treated as HTML. I assume IE works in a similar way.
This is "normal" behavior in that the trailing slash usage in XHTML-as-
text/html is dependent on such error-handling by the browser. XHTML-as-text/html is actually nothing more than slightly-broken HTML, and this test is a good demonstration of that fact. ;) </added>
Are you talking about XHTML 1.0 Strict (where the trailing slashes are required to validate) or HTML 4.01 Strict?
I did a search here, starting with this recent thread [webmasterworld.com] by SuzyUK (which I have to confess I had apparently skimmed too quickly when she posted it), and moving on to your (encyclo's) thread [webmasterworld.com] on the subject and finishing up with DrDoc's thread [webmasterworld.com], both from last August. I read the whole first page but my brain hurts now so I guess the other pages will have to wait for another day.
Apparently my error has been that my eyes unfocus once I see either 'transitional' or 'strict' in the doctype. I thought all this time that I was doing good, any new pages are written to 'strict' and as I modify older pages I change them to strict. I thought I wanted XHTML, but after all that reading it's abundantly clear that I want HTML 4.01 strict. Sigh, I have a lot of trailing backslashes to remove...
Thanks encyclo, both for today and your input in the other threads.
Do you have a powerful editor like HomeSite? It can rip through thousands of files in a few short seconds, even traversing subdirectories, on a global search and replace, without ever manually opening one file.
Oh and after I 'fixed' that one file (and did a validity check), FF started saving it ok but IE6 still changes it; sets it to transitional loose and capitalizes all the elements.