invalid comment declaration: found name character outside...
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4126
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
I came across this weird error:

:: Code ::
invalid comment declaration: found name character outside comment but inside comment declaration.

and found this solution:

:: Quote ::
This could very well be the most unique question I have ever read on the HTML/CSS forum...

As for the answer:
HTML is technically a SGML (Standard Generalized Markup Language) and it uses the comments specified by that language.

Now when learning HTML people are taught that HTML comment tags are as follows,

<!-- to begin a comment and --> to end a comment.

This however isn't technically how they work.

I'll try to explain clearly.

The <! tag opens a comment and the > tag closes it (similar to any other tag in HTML.

This therefore makes <!> a legal comment, which it is.

The '--' is equivillent to a quotation, and this quotation is required for any string you want to have within the comment (IE text) so if you want to write anything within a comment you have to put '--' around the text (string) you write.

Just like when you write a paper, any quote that opens has to be closed somewhere.

With this in mind the following are legal, examlpes of comments,
Code:

:: Code ::

<!>
<!-- -->
<!-- A comment -->
<!-- Comment A -- -- Comment B -->
<!-- Comment A -- --> Tricked you, its not closed yet -->
<!-- -- -- -->


So all you have to keep in mind when creating comments is that every -- you open you have to close somewhere.

So in order to make your line seperator comment legal, simply make the total number of dashes a multiple of 4.

Hope this explains things clearly, if not google html comments and you should be able to find websites which have some good examples...

Back to top
whansen02
Status: New User - Welcome
Joined: 06 Feb 2009
Posts: 1
Reply Quote
just a quick question if you're still on the board ...
I'm just learning & I'm wondering if the link you offered to html help central is a very reliable one?
Seems I've noticed a few junk ones (which is hard because I'm being self-taught).
Thanks.
Will
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4126
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
The solution on the link I posted is correct and valid, I have no idea about the general overall quality of the posters at that forum, but the person who had the correct answer was correct, and I'd never heard about that issue before, not in nearly 10 years of HTML/CSS hacking, so someone there has some clue.

<by the way, you get no google link credit for your signature link, log out and see....>
Back to top
Display posts from previous:   

All times are GMT - 8 Hours