tag balance tool ?

D

_Douglas Bell

Is there a tool for checking
to make sure all <tags> </tags> are balanced?
 
C

Chris Morris

_Douglas Bell said:
Is there a tool for checking
to make sure all <tags> </tags> are balanced?

If you use a validator [ http://validator.w3.org/ ] then it will tell
you if all tags that need to be closed are closed (this varies
depending on whether you are writing HTML or XHTML).

It will also point out other errors in your markup.
 
C

C A Upsdell

Chris Morris said:
_Douglas Bell said:
Is there a tool for checking
to make sure all <tags> </tags> are balanced?

If you use a validator [ http://validator.w3.org/ ] then it will tell
you if all tags that need to be closed are closed (this varies
depending on whether you are writing HTML or XHTML).

Validating to HTML will not tell you about many missing end tags, since in
HTML many end tags are optional. This is a concern for NN4, which can go
berserk when end tags are omitted.

Validating to xHTML will tell you about all missing end tags, since no end
tag is optional: this helps ensure better compatibility with NN4.
 
C

Chris Morris

C A Upsdell said:
Chris Morris said:
_Douglas Bell said:
Is there a tool for checking
to make sure all <tags> </tags> are balanced?

If you use a validator [ http://validator.w3.org/ ] then it will tell
you if all tags that need to be closed are closed (this varies
depending on whether you are writing HTML or XHTML).

Validating to HTML will not tell you about many missing end tags, since in
HTML many end tags are optional. This is a concern for NN4, which can go
berserk when end tags are omitted.

Validating to xHTML will tell you about all missing end tags, since no end
tag is optional: this helps ensure better compatibility with NN4.

However, browsers have problems with XHTML (Appendix C is a bit of a
hack to say the least, even if in practice for now it works). Perhaps
a good solution is to:

- write XHTML and validate it. Use Appendix C so you can test it in
IE at this stage.

- use some utility (HTML tidy or similar) to convert it to normal
HTML 4 before it goes live. It'll have all the close tags at this
point.
 
C

Chris Morris

m said:
Clarify, please


Appendix C?

XHTML documents are supposed to be sent as application/xhtml+xml and
have an <?xml ... ?> at the start. However, this breaks older
browsers (such as IE 6).

Appendix C allows them to be sent as text/html without the <?xml ?>
(as if they were a HTML document) and only works because browsers
never implemented SGML fully in the first place.
 
M

m

Chris said:
XHTML documents are supposed to be sent as application/xhtml+xml and
have an <?xml ... ?> at the start. However, this breaks older
browsers (such as IE 6).

Appendix C allows them to be sent as text/html without the <?xml ?>
(as if they were a HTML document) and only works because browsers
never implemented SGML fully in the first place.
Oh, I see now, you mean appendix C of
the XHTML specs...
http://www.w3.org/TR/xhtml1/#guidelines

I don't agree that you should give up
XHTML for HTML 4 (if I understood your
post correctly), but I can see how the
two paragraphs might worry some authors.
If it worried me, I'd just remove
"processing instructions and XML
declarations," and use the default
encoding of "UTF-8 or UTF-16".
I've never used anything beside UTF-8 on
any of my XHTML pages anyway. My own
site's opening page seems to me to
display and run fine in IE6.0.2800, even
though I use an XML declaration. Might
it be that there some internal settings
on IE6 that you have set wrong?

Cheers,
m
http://www.mbstevens.com/
 
M

m

Headless said:
And if you tell it not to. It can also remove valid and correct markup
with no option to prevent that from happening.

Yep. The two basic tenets of software
development.
1) always back up.
2) they always want more.

Cheers,
m
 

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,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top