Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 8449 | Replies: 8
![]() |
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 11,073
Reputation:
Rep Power: 33
Solved Threads: 118
Is there a program (such as Dreamweaver, Visual Studio.NET, etc) that will parse my HTML code and make it XHTML complient?
For example, I'd like to throw at it all of the pages of TechTalk forums and have it automatically convert, for example
to
For example, I'd like to throw at it all of the pages of TechTalk forums and have it automatically convert, for example
<input type=submit name=submit value=Go>
<input type="submit" name="submit" value="Go" />
Dani the Computer Science Gal
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 11,073
Reputation:
Rep Power: 33
Solved Threads: 118
#2
Feb 7th, 2003
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 11,073
Reputation:
Rep Power: 33
Solved Threads: 118
#3
Feb 7th, 2003
Nevermind, this makes no sense. When I take an HTML document and click on "convert to XHTML" all it does is add the following to the head:
It doesn't make any other changes?
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
It doesn't make any other changes?
Dani the Computer Science Gal
#4
Feb 8th, 2003
I don't know about converting your code to XHTML, but I know that all code in VS.NET (with reguard to ASP.NET Pages) are in XHTML format.
-Ryan Hoffman
ASP.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
ASP.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
•
•
Join Date: Feb 2002
Location: Long Island, NY
Posts: 1,134
Reputation:
Rep Power: 12
Solved Threads: 4
#5
Feb 15th, 2003
You can give XML Spy a try. Definitely an awesome program to do any XML development. I used this for a JSP shopping cart. You can give HTML Tidy a try but I'm not sure of its capabilities (have not tried it, though I hear is good). It's a free program under SourgeForge unlike XML Spy. Here are the web sites:
http://www.altova.com/products_ide.html
http://tidy.sourceforge.net/
If you need to convert to XHTML you can try this PHP function. It has some quirkiness at times. This is what I used when I was redesigning the Hofstra CSC web site for the CSC club.
http://www.altova.com/products_ide.html
http://tidy.sourceforge.net/
If you need to convert to XHTML you can try this PHP function. It has some quirkiness at times. This is what I used when I was redesigning the Hofstra CSC web site for the CSC club.
<?
if (!empty($type)) {
if ($type == "path") {
if (!empty($path)) {
if (file_exists($path) && is_file($path)) {
$file = file($path);
if (substr($file[0],0,9) != "<!DOCTYPE") $doctype=0;
$file = join('', $file);
} else {
die ("No such file.");
}
} else {
die ("No file specified.");
}
} elseif ($type == "file") {
if (!empty($file)) {
} else {
die ("No file specified.");
}
} else {
die ("No file specified.");
}
# specify html file, check for doctype
//$file = file("file.html");
//if (substr($file[0],0,9) != "<!DOCTYPE") $doctype=1;
//$file = join('', $file);
# make tags and properties lower case, close empty elements, quote all properties
$search = array ("'(<\/?)(\w+)([^>]*>)'e",
"'(<\/?)(br|input|meta|link|img)([^>]*)( />)'ie",
"'(<\/?)(br|input|meta|link|img)([^>]*)(/>)'ie",
"'(<\/?)(br|input|meta|link|img)([^>]*)(>)'ie",
"'(\w+=)(\w+)'ie",
"'(\w+=)(.+?)'ie");
$replace = array ("'\\1'.strtolower('\\2').'\\3'",
"'\\1\\2\\3>'",
"'\\1\\2\\3>'",
"'\\1\\2\\3 /\\4'",
"strtolower('\\1').'\"\\2\"'",
"strtolower('\\1').'\\2'");
$file = preg_replace($search, $replace, $file);
# return xhtml-compliant document
echo "<textarea cols=\"100\" rows=\"20\">";
if (isset($doctype)) echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">'."\n";
echo stripslashes(stripslashes(stripslashes($file)));
echo "</textarea>";
} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<head><title>HTML -> XHTML Convertor</title></head>
<body>
<!-- WARNING: this input method is a security risk on open servers //-->
<form action="<?=$PHP_SELF?>" method="get">
<input type="hidden" name="type" value="path" />
<font face="verdana">File path:</font> <input type="text" name="path" size="50" />
<input type="submit" value="Submit" />
</form>
<b><font face="verdana">OR</font></b><br /><br />
<form action="<?=$PHP_SELF?>" method="get">
<input type="hidden" name="type" value="file" />
<font face="verdana">File contents:</font><br />
<textarea name="file" rows="10" cols="50"></textarea><br />
<input type="submit" value="Submit" />
</form>
</body>
</html>
<?
}
?> •
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 11,073
Reputation:
Rep Power: 33
Solved Threads: 118
#6
Feb 15th, 2003
I found a Dreamweaver MX extension which does the trick perfectly. The only problem is that it automatically adds <HTML><HEAD> etc tags to the top and bottom of my code, to make it "complete".
The problem with this is that this forum uses a templating system, in which the top and bottom are shared borders. Therefore, I'd have to manually remove the top and bottom code from each page (and there are a LOT of pages)!
I'm procrastinating doing it for now. Debating whether it's worth my time or if next month I'll have a whole new design going (at which time I'll make it XHTML complient right from the start).
The problem with this is that this forum uses a templating system, in which the top and bottom are shared borders. Therefore, I'd have to manually remove the top and bottom code from each page (and there are a LOT of pages)!
I'm procrastinating doing it for now. Debating whether it's worth my time or if next month I'll have a whole new design going (at which time I'll make it XHTML complient right from the start).
Dani the Computer Science Gal
•
•
Join Date: May 2004
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
Hi, The coding is fine in PHP,
But it would be fine if some could provide me with the XHTML Parser and
XHTML Generator startup source code in C ? Or
Could give An Opensource XHTML Generator and XTHML Parser in C .
Thanks & Regards,
karthik
Opensource XHTML Generator and XHTML Parser in C .
But it would be fine if some could provide me with the XHTML Parser and
XHTML Generator startup source code in C ? Or
Could give An Opensource XHTML Generator and XTHML Parser in C .
Thanks & Regards,
karthik
•
•
•
•
Originally Posted by inscissor
You can give XML Spy a try. Definitely an awesome program to do any XML development. I used this for a JSP shopping cart. You can give HTML Tidy a try but I'm not sure of its capabilities (have not tried it, though I hear is good). It's a free program under SourgeForge unlike XML Spy. Here are the web sites:
http://www.altova.com/products_ide.html
http://tidy.sourceforge.net/
If you need to convert to XHTML you can try this PHP function. It has some quirkiness at times. This is what I used when I was redesigning the Hofstra CSC web site for the CSC club.
<? if (!empty($type)) { if ($type == "path") { if (!empty($path)) { if (file_exists($path) && is_file($path)) { $file = file($path); if (substr($file[0],0,9) != "<!DOCTYPE") $doctype=0; $file = join('', $file); } else { die ("No such file."); } } else { die ("No file specified."); } } elseif ($type == "file") { if (!empty($file)) { } else { die ("No file specified."); } } else { die ("No file specified."); } # specify html file, check for doctype //$file = file("file.html"); //if (substr($file[0],0,9) != "<!DOCTYPE") $doctype=1; //$file = join('', $file); # make tags and properties lower case, close empty elements, quote all properties $search = array ("'(<\/?)(\w+)([^>]*>)'e", "'(<\/?)(br|input|meta|link|img)([^>]*)( />)'ie", "'(<\/?)(br|input|meta|link|img)([^>]*)(/>)'ie", "'(<\/?)(br|input|meta|link|img)([^>]*)(>)'ie", "'(\w+=)(\w+)'ie", "'(\w+=)(.+?)'ie"); $replace = array ("'\\1'.strtolower('\\2').'\\3'", "'\\1\\2\\3>'", "'\\1\\2\\3>'", "'\\1\\2\\3 /\\4'", "strtolower('\\1').'\"\\2\"'", "strtolower('\\1').'\\2'"); $file = preg_replace($search, $replace, $file); # return xhtml-compliant document echo "<textarea cols=\"100\" rows=\"20\">"; if (isset($doctype)) echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">'."\n"; echo stripslashes(stripslashes(stripslashes($file))); echo "</textarea>"; } else { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <head><title>HTML -> XHTML Convertor</title></head> <body> <!-- WARNING: this input method is a security risk on open servers //--> <form action="<?=$PHP_SELF?>" method="get"> <input type="hidden" name="type" value="path" /> <font face="verdana">File path:</font> <input type="text" name="path" size="50" /> <input type="submit" value="Submit" /> </form> <b><font face="verdana">OR</font></b><br /><br /> <form action="<?=$PHP_SELF?>" method="get"> <input type="hidden" name="type" value="file" /> <font face="verdana">File contents:</font><br /> <textarea name="file" rows="10" cols="50"></textarea><br /> <input type="submit" value="Submit" /> </form> </body> </html> <? } ?>
Opensource XHTML Generator and XHTML Parser in C . •
•
Join Date: Jul 2004
Location: Toronto
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 1
If you're still looking, google "HTML Tidy". If that fails, it's on the W3C site somewhere.
•
•
Join Date: May 2004
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
In the past few days i have done enough R&D in this arena.
Has anyone come across / used a XHTML Parser generator
tool in Opensource community developed in C ?
Do Kindly post the link / tool name .
I saw Amaya but it is big and will consume time
to get just the XHTML Parser / Generator from it.
1) GENX is XML Parser and No XHTML Parser / Generator
tool
developed using GENX by GENX till now.
2) EXPAT doesnt provide a opensource XHTML Parser /
Generator till today.
3) X-Smiles is simple and good but Java Based .
4) LibXml is also a library and no XHTML parser /
Generator Tool by them in opensource till today.
Has Someone got a simple setup with just
the XHTML Parser and Generator alone developed in C
available in OpenSource
or
A tool Develped Using the above library tools ?
Kindly let me know And Do Give me your link.
Thanks & Regards,
karthik bala guru
Hi,
In the past few days i have done enough R&D in this arena.
Has anyone come across / used a XHTML Parser generator
tool in Opensource community developed in C ?
Do Kindly post the link / tool name .
I saw Amaya but it is big and will consume time
to get just the XHTML Parser / Generator from it.
1) GENX is XML Parser and No XHTML Parser / Generator
tool
developed using GENX by GENX till now.
2) EXPAT doesnt provide a opensource XHTML Parser /
Generator till today.
3) X-Smiles is simple and good but Java Based .
4) LibXml is also a library and no XHTML parser /
Generator Tool by them in opensource till today.
Has Someone got a simple setup with just
the XHTML Parser and Generator alone developed in C
available in OpenSource
or
A tool Develped Using the above library tools ?
Kindly let me know And Do Give me your link.
Thanks & Regards,
karthik bala guru
In the past few days i have done enough R&D in this arena.
Has anyone come across / used a XHTML Parser generator
tool in Opensource community developed in C ?
Do Kindly post the link / tool name .
I saw Amaya but it is big and will consume time
to get just the XHTML Parser / Generator from it.
1) GENX is XML Parser and No XHTML Parser / Generator
tool
developed using GENX by GENX till now.
2) EXPAT doesnt provide a opensource XHTML Parser /
Generator till today.
3) X-Smiles is simple and good but Java Based .
4) LibXml is also a library and no XHTML parser /
Generator Tool by them in opensource till today.
Has Someone got a simple setup with just
the XHTML Parser and Generator alone developed in C
available in OpenSource
or
A tool Develped Using the above library tools ?
Kindly let me know And Do Give me your link.
Thanks & Regards,
karthik bala guru
•
•
•
•
Originally Posted by Innocent
If you're still looking, google "HTML Tidy". If that fails, it's on the W3C site somewhere.
Hi,
In the past few days i have done enough R&D in this arena.
Has anyone come across / used a XHTML Parser generator
tool in Opensource community developed in C ?
Do Kindly post the link / tool name .
I saw Amaya but it is big and will consume time
to get just the XHTML Parser / Generator from it.
1) GENX is XML Parser and No XHTML Parser / Generator
tool
developed using GENX by GENX till now.
2) EXPAT doesnt provide a opensource XHTML Parser /
Generator till today.
3) X-Smiles is simple and good but Java Based .
4) LibXml is also a library and no XHTML parser /
Generator Tool by them in opensource till today.
Has Someone got a simple setup with just
the XHTML Parser and Generator alone developed in C
available in OpenSource
or
A tool Develped Using the above library tools ?
Kindly let me know And Do Give me your link.
Thanks & Regards,
karthik bala guru
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode