Newbie here, please excuse the apparent non-TextMate related question. Has anyone seen a bundle or suggestions on using tidy (or something) to convert old style HTML to newer transitional XHTML without screwing up embedded PHP (or other) code? It seems that by default tidy can really fowl up embedded PHP structures. I have a lot of old PHP-based documents that I'd like to get somewhat brought up- to-date.
Thanks, Ron
******************************************************* * Ron Patterson, Email: rpatter@asd20.org * * Web Services, Phone: 719.234.1707 * * Academy School District 20, FAX: 719.234.1706 * * Web Site: http://www.asd20.org * *******************************************************
Ron Patterson wrote:
Newbie here, please excuse the apparent non-TextMate related question. Has anyone seen a bundle or suggestions on using tidy (or something) to convert old style HTML to newer transitional XHTML
What's the use case? Please read [this](http://www.hixie.ch/advocacy/xhtml) before you decide to use XHTML. XHTML is almost always the wrong choice of format.
-Jacob
On Apr 2, 2007, at 4:59 PM, Jacob Rus wrote:
What's the use case? Please read [this](http://www.hixie.ch/ advocacy/xhtml) before you decide to use XHTML. XHTML is almost always the wrong choice of format.
I disagree with the hixie article for so many reasons. Its a preference. And it's not one that, at this point, really makes a whole lot of difference either way.;
My favorite of the initial responses to the hixie article: http://h3h.net/2005/12/xhtml-harmful-to-feelings/
And just for fun: http://meyerweb.com/eric/comment/chech.html?dupe=1
I have no desire for an argument but felt the need to answer that last email as I'm tired and probably a bit grumpy. In fact I don't consider the issue nearly big enough for the importance Hickson places on it. Let alone important enough to argue over for any extended length of time.
HTML itself is in such a state of flux right now (and hasn't it always been?) that when we worry about the kinds of things metioned in the hixie article I think we are getting a little silly.
Writing using XHTML encourages well formed code. I like that about it. I like that it makes me check to make sure I haven't done anything silly. If I end up serving that code as text/html until the end of the site's life I could really care less as long as it works reliably (and it does). By the time I might want to serve my pages as xml hopefully the w3c and the whatwg will have worked out their differences and given us something else. You do have your content in a database separate from both your markup structure and display code right? But even if they do work out something better we still have to rely on the browser devs to implement it correctly which they never seem to be capable of despite their sometimes best intentions.
Again I apologize if I'm upsetting anyone. It wasn't my intention.
Jamie
_______________________________________________________________________ Email: jamie@methnen.com Homepage: http://www.methnen.com
"And I always go to pieces. And I have it in my mind, that the sky is tall and heavy, when I could be brave." -Karen Peris (Brave)
"I want to find where the maid in the street is pouring her wine, I heard she takes you in and gives you the words you need said. If you'll be her brother, she'll kiss you like a sister. She'll even be your mother, for now." -Matt Slocum (Sister, Mother)
"And we are drowned." -Annie Dillard (Tickets For a Prayer Wheel) _______________________________________________________________________
Methnen (AKA Jamie) wrote:
I disagree with the hixie article for so many reasons. Its a preference. And it's not one that, at this point, really makes a whole lot of difference either way.;
My favorite of the initial responses to the hixie article: http://h3h.net/2005/12/xhtml-harmful-to-feelings/
Just about everything in this post you linked either misses the point, or is wrong, or uses fallacious reasoning, or all three at once.
And just for fun: http://meyerweb.com/eric/comment/chech.html?dupe=1
Fair enough.
I have no desire for an argument but felt the need to answer that last email as I'm tired and probably a bit grumpy.
Yep. Me neither.
What I think you missed was that the original email in this thread was about converting *existing html documents* to xhtml. There is literally no advantage to this, unless there's some need to use xml tools, or some plan to integrate svg/mathml/etc. with the old content. But as both of those are unlikely, it's probably a bad idea, as there are several disadvantages, as explained in Ian Hickson's article, mainly having to do with cross-browser copatibility.
HTML itself is in such a state of flux right now (and hasn't it always been?) that when we worry about the kinds of things metioned in the hixie article I think we are getting a little silly.
Yes. Which is why it's stupid to improperly use the rapidly-changing, unsupported xhtml, instead of the reasonably stable, and much more compatible html, without some particular good reason.
Writing using XHTML encourages well formed code [...]
Or you could just... write well-formed code anyway...
But even if they do work out something better we still have to rely on the browser devs to implement it correctly which they never seem to be capable of despite their sometimes best intentions.
It's odd that you seem to get the point here in this last sentence though, after having ignored it for the rest of your email. ;)
* * *
Anyway, it's definitely not worth fighting about. I don't really care what you use in your pages. But the original poster may want to carefully consider the reasons for switching existing content to xhtml. It's a lot of hassle for essentially nothing.
-Jacob
Methnen (AKA Jamie) wrote:
My favorite of the initial responses to the hixie article: http://h3h.net/2005/12/xhtml-harmful-to-feelings/
Incidentally, I find it incredibly amusing that that article says:
<script> and <style> elements in XHTML sent as text/html have to be escaped using ridiculously complicated strings.
This is not an issue if one includes scripts and stylesheets as external resources from their own files. This helps caching, organization, and modularization of code and should be used in all production environments. In the very rare case that scripts or styles need to included on the XHTML page itself, two extra lines delimiting CDATA blocks are not “harmful” to any degree. Not Harmful
When its own html has:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <script type="text/javascript"> <!-- var ajax; [...]
Whoops! I suppose his blog doesn't count as a "production environment", or perhaps that this particular "rare case" just slipped by the easy extra-two-lines addition.
-Jacob
On 2. Apr 2007, at 22:08, Ron Patterson wrote:
[...] Has anyone seen a bundle or suggestions on using tidy (or something) to convert old style HTML to newer transitional XHTML without screwing up embedded PHP (or other) code? [...]
What exactly is the conversion supposed to do? Add a trailing slash to all tags with an EMPTY content model?
It has been said a few times before on this list, but do think twice before switching to XHTML: http://www.hixie.ch/advocacy/xhtml
Since it last was up, new development has happened; the W3C has acknowledged the need for a new version of HTML and restarted development on this standard [1] (parallel to W3C, the WhatWG has been doing work on HTML5 [2], and W3C ).
[1]: http://www.w3.org/2007/03/html-pressrelease [2]: http://www.whatwg.org/specs/web-apps/current-work/