XHTML 1.0 Strict to HTML5 batch conversion
I came across a situation where I needed to convert a bunch of XHTML 1.0 Strict documents (or snippets) to valid HTML5.
This tool automates the process.
Note that this will not add any new HTML5 elements/features to your pages.
It merely gets rid of deprecated XHTML 1.0 Strict elements/attributes or replaces them with conforming ones.
There are two "products" in here:
- Browser-based, drag-and-drop batch conversion:
- Download and extract the files. (or use the demo here)
- Visit index.html in Firefox 3.6+ (if you are using Chrome/Chromium, see note below)
- Drag/drop your valid XHTML 1.0 Strict files in the marked area.
- If everything goes according to plan you'll be asked to download a zip file containing the HTML5 equivalent of your files.
- For more information (or if the conversion failed), take a look at the "Output" area. Messages will be added there as the files are processed.
- Dreamweaver extension
- Open "dw-x2h.mxi" with the "Adobe Extension Manager"
- Access 'XHTML to HTML5' entry in the 'Commands' menu
- Select the folder containing your XHTML files
- Wait while DW converts the files
- At the end, you'll be left with an opened document containing notes and information on the conversion, if applicable.
What exacly does this do to my documents?
- Replaces <acronym> with <abbr>
- Replaces <big> with <span class="big">
- Replaces <tt> with <span class="tt">
- Removes @summary from <table>
- Replaces @cellpadding/@cellspacing with a class (ex: class="cellpadding5" instead of cellpadding="5") on <table>
- Removes @nohref from <area>
- Removes @profile from <head>
- Removes @archive, @classid, @codebase, @codetype, @declare, @standby from <object>
- Removes @type and @valuetype from <param>
- Removes @charset, @name, @rev and @shape from <a>
- Removes @charset and @rev from <link>
- Removes @abbr, @axis, @valid from <td> and <th>
- Removes @scope from <td>
- Removes @scheme from <meta>
- Removes @longdesc from <img>
- If you want to use this locally (file://) with Chrome/Chromium you need to start the browser with: --allow-file-access-from-files --allow-file-access Otherwise you'll get "Security error".
- The tool has been tested with:
- Firefox 3.6.21, 6.0.2, 7.0.1, 8.0.1
- Chromium 14.0.835.186
- Opera 11.50
- Dreamweaver CS5