W3C home > Mailing lists > Public > www-html@w3.org > June 2006

Identifying end tags

From: Nickolas Nansen <nick_nansen@hotmail.com>
Date: Thu, 22 Jun 2006 18:16:28 +0200
To: www-html@w3.org
Message-ID: <BAY19-F1929E1634D9482111989E886850@phx.gbl>

Hi there

Working with nested tables, div tags and other elements may cause problems
when combining code and especially when there will be different levels of
nesting. It's not always easy to keep track of how many div's to end at the
end of the local code and there is a potential risk of making problems for
the framing code. Because of this I would like to know if there is or could
be made an attribute used by programmers to keep track of the tags. The
easiest part would be to use the id/class attribute also at ending the tag,
but I am not sure whether this would confuse some browsers.
I have used comments but they have a tendency to separate from the tag  
a while, and having too many comments after each other also seems to make
problems for some browsers.

An example (not indented to make a small example illustrate the confusion
more visible. Besides indenting rarely works so well it should be used as  
indicator of relations.)

<div id="design">
<div id="content">
<div id="maincontent">
<div id="related">

With comments
<div id="design">
<div id="content">
<div id="maincontent">
<div id="related">

With attributes
<div id="design">
<div id="content">
<div id="maincontent">
<div id="related">
</div id="related">
</div id="maincontent">
</div id="content">
</div id="design">

Even though using id/class would be the best, making it easy to identify
both id's and classes with potentially identical names, I guess it may be
confusing for both browser and programmers. One solution would be to add e
for ending to the attribute. Then it should be a new attribute that
hopefully doesn't trigger any action in any browser, and it also helps
programmers to see that it is an end-tag and not a new div of the same ID.

<div id="design">
<div id="content">
<div id="maincontent">
<div class="related">
</div eclass="related">
</div eid="maincontent">
</div eid="content">
</div eid="design">

These are just some random thoughts from someone trying to make neat and
readable code. I believe you have the knowledge both to understand my
problems and to find the best way to solve this.

I would appreciate an answer to this, even if you won't do anything about
it, just to know that the problem has been considered.

Best regards
Nickolas Nansen

MSN Spaces http://spaces.msn.com/?mkt=nb-no Vis hvem du er og hva du vil
Received on Friday, 23 June 2006 07:37:23 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:06:13 UTC