|
|
XHTML convert to HTML
|
|
|
|
Mac Elite
Join Date: Apr 2003
Location: Hong Kong
Status:
Offline
|
|
This may sound weird, but I have a stack of pages that are coded in XHTML and I want to convert them to HTML strict - is there any easy way to do so or does any application automate this?
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status:
Offline
|
|
That does sound weird, what are you trying to accomplish? If I may ask...?
|
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Because most servers identify XHTML documents as HTML anyway, and he wants it to at least be valid HTML?
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Apr 2003
Location: Hong Kong
Status:
Offline
|
|
Originally Posted by Chuckit
Because most servers identify XHTML documents as HTML anyway, and he wants it to at least be valid HTML?
Exactly, and the fact that IE does not render XHTML correctly at all (even IE7!) Consider that there is still a huge user base using IE and will do from some time, I want to use HTML strict instead of XHTML, but I have a job that was partially completed using XHTML and I wanted to convert (if possible) the existing pages to HTML, instead of me having to start from scratch again.
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Why not just use your HTML in XHTML Transitional, and simply respect the deprecated tags and extremely minor changes?
I haven't had a problem this way...
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally Posted by besson3c
Why not just use your HTML in XHTML Transitional, and simply respect the deprecated tags and extremely minor changes?
I haven't had a problem this way...
Because his server sends the document as text/html, in which case it will be interpreted as HTML, so it makes sense just to use HTML?
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Originally Posted by Chuckit
Because his server sends the document as text/html, in which case it will be interpreted as HTML, so it makes sense just to use HTML?
Right, I understand that... but it seems like more trouble to convert everything back to HTML.
If you had to, I bet you could with some simple search/replaces, including the doctag.
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
I think Tidy can do this automatically. Just run the XHTML through like you're validating it, but tell it to output HTML instead of XHTML.
|
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Aug 2001
Location: Durango CO
Status:
Offline
|
|
Andy8. IE should render XHTML just fine. I think you might have other problems with your code.
|
|
|
|
|
|
|
|
|
Junior Member
Join Date: Nov 1999
Status:
Offline
|
|
I have never heard of IE having any problems with XHTML. Can you post your code here that is causing problems?
As another poster suggested, Tidy may be able to do what you need.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Apr 2003
Location: Hong Kong
Status:
Offline
|
|
Reading articles like this makes me want to use HTML not XHTML - no support for XHTML in IE 6 or IE7. The comments make interesting reading.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Apr 2003
Location: Hong Kong
Status:
Offline
|
|
Or do I just serve the XHTML as text for now and be done with it?
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Aug 2001
Location: Durango CO
Status:
Offline
|
|
sounds like you are trying to serve it as XML? that will likely cause browser problems.
|
|
|
|
|
|
|
|
|
Registered User
Join Date: Apr 2004
Status:
Offline
|
|
There is virtually *no* difference between HTML Strict, and XHTML Strict (served as text/html). Sounds like an exercise in futility, unless you're using a language that doesn't support XHTML correctly (ASP, I'm glaring at you).
In any event, a doctype switch and some regex to find trailing slashes would take care of that problem in minutes.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Apr 2003
Location: Hong Kong
Status:
Offline
|
|
Originally Posted by LiquidGuy
There is virtually *no* difference between HTML Strict, and XHTML Strict (served as text/html). Sounds like an exercise in futility, unless you're using a language that doesn't support XHTML correctly (ASP, I'm glaring at you).
In any event, a doctype switch and some regex to find trailing slashes would take care of that problem in minutes.
What is the correct doctype to serve it up as text instead of xml? - I am going to stick with XHTML strict for now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|