convert html to xhtml

Posted by Mohsinkhan.P under HTML 5 on 7/20/2012 | Points: 10 | Views : 4006 | Status : [Member] | Replies : 17
hi,
How to convert html code to xml using code.




Responses

Posted by: Sakthi.Singaravel on: 7/21/2012 [Member] Silver | Points: 25

Up
0
Down
did u need to convert xml or xhtml

Regards,
Singaravel M

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mohsinkhan.P on: 7/21/2012 [Member] Starter | Points: 25

Up
0
Down
HI shakti.
I need to convert html file to xml using code.
So i got infomation to first convert it to xhtml than you can convert it to xml.
so how can i do this.

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 7/21/2012 [Member] Silver | Points: 25

Up
0
Down
http://www.codeproject.com/Articles/10792/Convert-HTML-to-XHTML-and-Clean-Unnecessary-Tags-a

Regards,
Singaravel M

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 7/21/2012 [Member] Silver | Points: 25

Up
0
Down
Try this article,

http://www.eggheadcafe.com/articles/20030317.asp

Regards,
Singaravel M

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mohsinkhan.P on: 7/21/2012 [Member] Starter | Points: 25

Up
0
Down
http://www.eggheadcafe.com/articles/20030317.asp

how can i use this. Where can i specify my html file name. and converted destination file name. and what all namespaces should i

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 7/21/2012 [Member] Silver | Points: 25

Up
0
Down
............
public string ProcessString(string strInputHtml )
{
string strOutputXhtml = String.Empty;
SgmlReader reader = new SgmlReader();
reader.DocType ="HTML";
...............................

Pass ur input file location as string variable...

Regards,
Singaravel M

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 7/21/2012 [Member] Silver | Points: 25

Up
0
Down
That code is class file download it..(See attachdocument )
use it...
 Download source file

Regards,
Singaravel M

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mohsinkhan.P on: 7/21/2012 [Member] Starter | Points: 25

Up
0
Down
i gave the source file in place strInputHtml
public string ProcessString(string strInputHtml )

but still unable to see the output.
where should i specify the outputfile or the source for output file.

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ranjeet_8 on: 7/23/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
Refer this link
it will help u...
http://www.cruto.com/resources/code-generators/code-converters/html-to-xhtml.asp

.

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 7/23/2012 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Good Day

@Ranjeet_8 your link is not correctly formatted, please fix the URL

Thank you for posting at Dotnetfunda
[Administrator]

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 7/24/2012 [Member] Starter | Points: 25

Up
0
Down
Hi
Singaravel M

Nice link
It is very helpful

R D Patel

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anishaticzon on: 8/16/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,i am sharing a link which will show you about the difference of this two system.
http://www.techyv.com/questions/difference-between-html-and-xhtml
and let you know what to do to convert them.

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kishon on: 9/18/2012 [Member] Starter | Points: 25

Up
0
Down
http://webdesign.about.com/od/xhtml/a/aa013100b.htm


Alwin

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kishon on: 9/18/2012 [Member] Starter | Points: 25

Up
0
Down
http://webdesign.about.com/od/xhtml/a/aa013100b.htm
Check this link


Regards
Alwin


Alwin

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 9/18/2012 [Member] Bronze | Points: 25

Up
0
Down
The W3C, which is the organization that co-ordinates standardisation of Web protocols, has defined three types of XHTML documents. This is based on the XML Document Type Definition (DTD) that is used by the document. The XHTML DTDs are:

Strict : Used when the XHTML document is devoid of all formatting tags like <font> and Cascading Style Sheets (CSS) are used for controlling all presentation aspects.
Transitional : This XHTML DTD allows use of presentation tags in the document. This is a safer mode since most of our pages contain many presentation elements.
Frameset : Used for XHTML documents that describes frames.

1)The first line in the HTML document may be the XML processing instruction:

<?xml version="1.0" encoding="iso-8859-1"?>
2) The second line in the XHTML document should be the specification of the document type declaration (DTD) used. The document type declaration for transitional XHTML documents is:

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

The declarations for the strict XHTML DTD is:


<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

The declarations for the frameset XHTML DTD is:

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
3)The starting tag <html> should be modified to include namespace information. The modification is:

<html xmlns="http://www.w3.org/1999/xhtml" lang="EN">


Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 9/18/2012 [Member] Bronze | Points: 25

Up
0
Down
Please mark as answer if it helpful to you...That helps others who search the same...

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kishon on: 11/23/2012 [Member] Starter | Points: 25

Up
0
Down
please check the below link

http://www.bejoy.in/Techzone/Convert-html-to-xhtml

Regards
Alwin

Alwin

Mohsinkhan.P, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response