LISTSERV mailing list manager LISTSERV 15.5

Help for XML-L Archives


XML-L Archives

XML-L Archives


View:

Next Message | Previous Message
Next in Topic | Previous in Topic
Next by Same Author | Previous by Same Author
Chronologically | Most Recent First
Proportional Font | Monospaced Font

Options:

Join or Leave XML-L
Reply | Post New Message
Search Archives


Subject: Re: Attributes Vs Elements
From:Michaël Bellefroid <[log in to unmask]>
Reply-To:General discussion of Extensible Markup Language <[log in to unmask]>
Date:Thu, 14 Sep 2000 12:47:47 +0200
Content-Type:text/plain
Parts/Attachments:
Parts/Attachments

text/plain (66 lines)


You have to think about containers and descriptors.
If the item is a container => element
If the item is a description => attribute.

I like the bottle example :

You have 3 things that describe the bottle :
- what is in it,
- the color of the glass
- the transparancy degree.

Thinking of the container & descriptors it give you this schema :

<bottle color="green" transparancy="80%">
        <liquid>Whiskey</liquid>
</bottle>

so in your example, color must be an attribute.

Mikl


-----Original Message-----
From: Santosh Kumar [mailto:[log in to unmask]]
Sent: Thursday, September 14, 2000 12:31 PM
To: [log in to unmask]
Subject: Attributes Vs Elements


Hi all,

  When should one decide to use attributes instead of elements
containing the data. I mean to say..How do i decide which one to use and
when?

<text>
  <color>red</color>
  <content>Contains data</content>
</text>

or

<text color="red">
  <content>Contains data</content>
</text>

Not every case is as simple as above.& what is the trade off?


Regards,
Santosh.


 ==========================================================================
=  Santosh Kumar C                                                        =
=  Senior Systems Engineer                                                =
=  Wipro Technologies                                                     =
=  1-8-448, Laxmi Building, S.P. Road,                                    =
=  Begumpet, Secunderabad - 500 003                                       =
=  A.P, India.                                                            =
=  Phone@: 91407896008 Ext 4511                                           =
=  Fax  @: 91407896123                                                    =
=  eMail@: [log in to unmask]                                        =
=  url  @: http://www.wipro.com                                           =
=  The World's First SEI CMM Level 5 Software Services Company            =
 ==========================================================================

Back to: Top of Message | Previous Page | Main XML-L Page

Permalink



LISTSERV.HEANET.IE

CataList Email List Search Powered by the LISTSERV Email List Manager