A HTML document can be converted to XHTML document.

M

mike

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
 
C

Chris Smith

mike said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top