Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » error, Duplicate tag (HTML).
error, Duplicate tag (HTML). [message #59699] Sun, 28 October 2007 04:01 Go to next message
Eclipse UserFriend
Originally posted by: samw3office.gmail.com

Hello All,

I'm getting a "Duplicate tag (HTML)." error on the second <DOCTYPE> tag
in my script as well as a "Duplicate tag (html)." warning on the second
<html> tag.

Is PDT doing this? and if so, can I set it somehow to not do it? (like
ignore or something?)

Thanks!

Sam Washburn

The script I'm using boils down to this...

<?
if($something) {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<body>
DISPLAY ONE FORM
</body>
</html>
<?
} else {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<body>
DISPLAY DIFFERENT FORM
</body>
</html>
<?
}
?>
Re: error, Duplicate tag (HTML). [message #59723 is a reply to message #59699] Sun, 28 October 2007 15:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ganoro.gmail.com

The HTMLValidator generates this error message. Semnatically your snippet
is valid though consider using this equivalent snippet.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<body>
<?
if ($something) {
?>
DISPLAY ONE FORM
<?
} else {
?>
DISPLAY DIFFERENT FORM
<?
}
?>
</body>
</html>
Re: error, Duplicate tag (HTML). [message #59770 is a reply to message #59723] Sun, 28 October 2007 16:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: samw3office.gmail.com

Thanks but..
Is the HTMLValidator a part of PDT or just eclipse? It would be nice
if there was a way to selectively choose which errors the validator
calls an error.

The code snippet you offered would solve the problem, however, I my
other code logic makes it a bit difficult.. kind of like this:
<?
if($_REQUEST['form_clicked']){
// Process form here..
// Then redirect to another page.
} elseif($something) {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html><body>DISPLAY ONE FORM</body></html>
<?
} else {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html><body>DISPLAY DIFFERENT FORM</body></html>
<?
}
?>




Roy Ganor wrote:
> The HTMLValidator generates this error message. Semnatically your
> snippet is valid though consider using this equivalent snippet.
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <html>
> <body>
> <?
> if ($something) {
> ?>
> DISPLAY ONE FORM
> <?
> } else {
> ?>
> DISPLAY DIFFERENT FORM
> <?
> }
> ?>
> </body>
> </html>
>
>
>
>
>
Re: error, Duplicate tag (HTML). [message #59794 is a reply to message #59770] Mon, 29 October 2007 06:45 Go to previous message
Roy Ganor is currently offline Roy GanorFriend
Messages: 150
Registered: July 2009
Senior Member
It is not a bug of the validator, since the validator can't understand
(semantically) the meaning of the program, it is an undecidable question.

Again, you should state the doctype only once in your document, for
example you can write a function that writes the doctype and then you call
it from the two branches that need to use it.
Previous Topic:Feature question for depoying
Next Topic:[Article] Extending the PDT project
Goto Forum:
  


Current Time: Mon Jan 30 12:24:30 GMT 2023

Powered by FUDForum. Page generated in 0.44430 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top