PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 23rd, 2004, 01:44 PM
lock lock is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 lock User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Auto-converting HTML to XHTML

Hi,

Im currently building some software that will allow HTML to be automatically converted to XHTML and then display either the code alone or the actual page to the user.

The process would be: User inputs HTML, HTML is then taken, stored in a buffer and converted to XHTML.

However, Im rather stuck as to how I will actually complete the process. Or what is the best method available to complete this project?

I was recommended PHP and using the search and replacewith functions. This would obviously replace the HTML tags with XHTML tags. Is this the best option though? Or is there an easier way?

Any help would be greaty appreciated, cheers

Reply With Quote
  #2  
Old October 24th, 2004, 12:54 AM
manoloweb manoloweb is offline
Moderated
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Monterrey MX
Posts: 49 manoloweb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
First of all, what you are planning sounds great, but it will take a lot more than just replacing tags or tag names.

XHTML is not only <strong> instead of <b> (and so...), it must be well-formed, and make use of some directives, like DOCTYPE encoding, language, etc...

So, you can't just find-and-replace, you need to parse the document, detect unclosed tags and close them, look for incorrectly nested blocks and fix them, identify character usage and state an appropiate encoding... and so on.

You might find this page useful...
http://www22.brinkster.com/beeandnee/techzone/articles/htmltoxhtml.asp

__________________
The deal is not to know everything, but to know the email of the one who does.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Auto-converting HTML to XHTML


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT