Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Re: Converting transitional to strict

Reply
Thread Tools

Re: Converting transitional to strict

 
 
GTalbot
Guest
Posts: n/a
 
      05-20-2010
On 16 mai, 09:10, Alfred Molon <alfred_mo...@yahoo.com> wrote:

> I was trying to convert the pages from my site from transitional to
> strict and ran into problems.


[snipped]

> I was wondering if perhaps some
> translators/converters exist, which convert transitional code into
> strict code.



HTML Tidy would do that but it's not a perfect tool to convert page
written according to a transitional DTD into one written according to
strict DTD.

There are several HTML Tidy options which do that:

clean:
This option specifies if Tidy should strip out surplus presentational
tags and attributes replacing them by style rules and structural
markup as appropriate. It works well on the HTML saved by Microsoft
Office products.
http://tidy.sourceforge.net/docs/quickref.html#clean

drop-font-tags:
This option specifies if Tidy should discard <FONT> and <CENTER> tags
without creating the corresponding style rules. This option can be set
independently of the clean option.
http://tidy.sourceforge.net/docs/qui...drop-font-tags

enclose-block-text:
This option specifies if Tidy should insert a <P> element to enclose
any text it finds in any element that allows mixed content for HTML
transitional but not HTML strict.
http://tidy.sourceforge.net/docs/qui...ose-block-text

Best is still to learn how to fix HTML errors starting from the W3C
markup validator and learn how to avoid writing HTML errors in the
first place.

I use Bluefish 1.0.7 with HTML Tidy on Linux; I use PSPad 4.5.4 with
HTML Tidy on Windows.

These are the arguments I use with Bluefish:

tidy --char-encoding utf8 --clean yes --doctype strict --drop-font-
tags yes --drop-proprietary-attributes yes --enclose-block-text yes --
enclose-text yes -indent --logical-emphasis yes --output-html yes --
replace-color yes --show-warnings no --wrap 76 --write-back yes >'%f'
2>/dev/null

regards, Gérard
--
Internet Explorer 7 bugs: 185 bugs so far
http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/
Internet Explorer 8 bugs: 60 bugs so far
http://www.gtalbot.org/BrowserBugsSection/MSIE8Bugs/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting 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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Converting transitional to strict Jukka K. Korpela HTML 65 06-05-2010 10:43 AM
Re: Converting transitional to strict dorayme HTML 1 05-18-2010 11:12 PM
Re: Converting transitional to strict Beauregard T. Shagnasty HTML 3 05-17-2010 05:39 PM
Re: Converting transitional to strict Neredbojias HTML 1 05-16-2010 07:32 PM
Re: Converting transitional to strict Adrienne Boswell HTML 1 05-16-2010 06:37 PM



Advertisments