Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > A HTML document can be converted to XHTML document.

Reply
Thread Tools

A HTML document can be converted to XHTML document.

 
 
mike
Guest
Posts: n/a
 
      01-11-2005
regards:

From http://webpageworkshop.co.uk/main/xhtml_converting
A HTML document can be converted to XHTML document.
By the following Steps:

Step 1: Convert elements to lowercase
Step 2: Replace the !DOCTYPE declaration
Step 3: Change the <html> tag
Step 4: Make sure all elements are closed
Step 5: Ensure all attributes are quoted
Step 6: 'Un-minimize' minimized attributes
Step 7: Make sure that every image has an 'alt' attribute
Step 8: Check for 'overlapping' elements
Step 9: Check 'type' attributes for script and style elements
Step 10: Validate your code!

Could I achieve the above 10 steps by using HTMLparer?
http://htmlparser.sourceforge.net/javadoc/index.html

Welcome to see your opinions.
Or maybe I may try another api like JDOM?
http://www.jdom.org/docs/apidocs/index.html


thank you
May god be with you
 
Reply With Quote
 
 
 
 
Collin VanDyck
Guest
Posts: n/a
 
      01-11-2005
mike wrote:
> regards:
>
> From http://webpageworkshop.co.uk/main/xhtml_converting
> A HTML document can be converted to XHTML document.
> By the following Steps:
>

<snip/>

Try JTidy.

 
Reply With Quote
 
 
 
 
Chris Smith
Guest
Posts: n/a
 
      01-14-2005
mike <> wrote:
> Could I achieve the above 10 steps by using HTMLparer?
> http://htmlparser.sourceforge.net/javadoc/index.html
>
> Welcome to see your opinions.
> Or maybe I may try another api like JDOM?
> http://www.jdom.org/docs/apidocs/index.html


I only took a brief look at the HTMLParser project you mentioned, but it
looks like it compares poorly to NekoHTML and Xerces, the combination of
which would allow you to easily parse XML into a standardized DOM model,
perform the transformations you propose to convert to XHTML (though
NekoHTML would do a lot of the work for you), and finally serialize out
to an XML document.

The big difference is in the DOM interface, which is the universal
standard representation of an XML document, versus the HTMLParser
project's proprietary interface, which doesn't appear to be much
intended for XML at all.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
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
PSD to XHTML Conversion, PSD to HTML, Joomla, Drupal, WordpressConversion, PSD to XHTML CSS xhtml champs XML 0 08-02-2011 05:40 AM
PSD to XHTML Conversion, PSD to HTML, Joomla, Drupal, WordpressConversion, PSD to XHTML CSS xhtml champs C Programming 0 08-01-2011 06:29 AM
Loading a simple XHTML transitional document into aorg.w3c.dom.Document Ion Freeman Java 17 07-11-2009 10:17 PM
translate a HTML document into a XHTML document mike Java 3 01-24-2005 09:42 AM
A HTML document into a XHTML document(wap2.0 mobile profile) mike XML 6 10-14-2004 09:02 PM



Advertisments