🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.sgml
Article #471

Re: Class vs. Instance Attributes

#471
From: Erik Naggum
Date: Thu, 23 May 1991 17:28
54 lines
3090 bytes
Eswar Priyadarshan - Sun BOS Software writes:
| 
|    I have another in the series of philosophical questions being asked
|    about attributes. In the application we're contemplating, we
|    seem to be running into what could be viewed as 2 types of
|    attributes of an element:
|
| 	   1. attributes whose value is the same for all instances of the
| 	      element. That is, the attributes are used to distinguish
| 	      one element from all others. For example, all text tagged
| 	      Foo is to be considered confidential. 
| 
| 	      The DTD would define an attribute for Foo whose only/default
| 	      value would be, to use the example, CONFIDENTIAL=Yes.

Apart from picking on the choice of attribute name and value (I think
it makes more sense to call it "security=confidential"), this can be
done to "subtype" a tag to the application.  In such as case, "#FIXED
confidential" is probably not a bad choice for the default value.

| 	   2. attributes whose value differs from instance to instance.
| 	      That is, the DTD would define a set of possible values
| 	      an attribute can have for text tagged Foo. Each instance
| 	      of the element Foo could have a different attribute
| 	      value within that set.
| 
|    Is the use of an attribute in case 1 ok?

It's being used with the #FIXED form in HyTime and SMDL, which leads
me to believe it's probably OK.  :-)

|    Seems to me that instead of using attributes in case 2, nested
|    tags should be used. Use attributes only when talking about every
|    instance of an element?

This seems to be a philosophical point worth considering.  Steve
DeRose's note is to the point, here.  ID's in particular vary between
instances of elements.  IDREF(S) also need attributes to work.

My stand in this debate is that attributes tell something _about_ a
given element, which is neither structural nor content.  As Steve
point out, the type of a list (e.g. bulleted) naturally belongs in an
attribute.  (Whether that attribute is added explicitly or at link
time is another matter.  For formatting-oriented things, I would
probably favor LINKs, which make things much easier to change.)

The question still remains:  How do you figure out what's content,
attribute, and structure?

</Erik>
--
Erik Naggum             Professional Programmer            +47-2-836-863
Naggum Software             Electronic Text             <ERIK@NAGGUM.NO>
0118 OSLO, NORWAY       Computer Communications        <enag@ifi.uio.no>
Technical Details
Message-ID: <ENAG.91May23192753@gyda.ifi.uio.no>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!ugle.unit.no!nuug!ifi!enag
References: <6271@eastapps.East.Sun.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!ugle.unit.no!nuug!ifi!enag
From: enag@ifi.uio.no (Erik Naggum)
Newsgroups: comp.text.sgml
Subject: Re: Class vs. Instance Attributes
Message-ID: <ENAG.91May23192753@gyda.ifi.uio.no>
Date: 23 May 91 17:28:01 GMT
References: <6271@eastapps.East.Sun.COM>
Sender: enag@ifi.uio.no (Erik Naggum)
Organization: Naggum Software, Oslo, Norway
Lines: 54
In-Reply-To: eswarp@dosai.East.Sun.COM's message of 22 May 91 13: 32:13 GMT