Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > XHTML convert to HTML

XHTML convert to HTML
Thread Tools
Andy8
Mac Elite
Join Date: Apr 2003
Location: Hong Kong
Status: Offline
Reply With Quote
Nov 27, 2006, 11:04 AM
 
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?
     
SirCastor
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Nov 27, 2006, 05:07 PM
 
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
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Nov 27, 2006, 05:29 PM
 
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'."
     
Andy8  (op)
Mac Elite
Join Date: Apr 2003
Location: Hong Kong
Status: Offline
Reply With Quote
Nov 27, 2006, 08:03 PM
 
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.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 27, 2006, 08:16 PM
 
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...
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Nov 27, 2006, 08:37 PM
 
Originally Posted by besson3c View Post
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'."
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 27, 2006, 09:10 PM
 
Originally Posted by Chuckit View Post
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.
     
Millennium
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Nov 28, 2006, 10:34 AM
 
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!
     
mania
Mac Enthusiast
Join Date: Aug 2001
Location: Durango CO
Status: Offline
Reply With Quote
Nov 28, 2006, 02:11 PM
 
Andy8. IE should render XHTML just fine. I think you might have other problems with your code.
The Bitcastle
graphic design, web development, hosting
     
mrl14
Junior Member
Join Date: Nov 1999
Status: Offline
Reply With Quote
Nov 30, 2006, 02:49 AM
 
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.
Get FREE software, legally

http://www.trybeta.com
     
Andy8  (op)
Mac Elite
Join Date: Apr 2003
Location: Hong Kong
Status: Offline
Reply With Quote
Nov 30, 2006, 10:47 AM
 
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.
     
Andy8  (op)
Mac Elite
Join Date: Apr 2003
Location: Hong Kong
Status: Offline
Reply With Quote
Nov 30, 2006, 10:55 AM
 
Or do I just serve the XHTML as text for now and be done with it?
     
mania
Mac Enthusiast
Join Date: Aug 2001
Location: Durango CO
Status: Offline
Reply With Quote
Nov 30, 2006, 03:56 PM
 
sounds like you are trying to serve it as XML? that will likely cause browser problems.
The Bitcastle
graphic design, web development, hosting
     
LiquidGuy
Registered User
Join Date: Apr 2004
Status: Offline
Reply With Quote
Nov 30, 2006, 05:33 PM
 
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.
     
Andy8  (op)
Mac Elite
Join Date: Apr 2003
Location: Hong Kong
Status: Offline
Reply With Quote
Dec 15, 2006, 08:02 PM
 
Originally Posted by LiquidGuy View Post
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 Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:07 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,