[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Attributes v Elements [conclusions]

  • From: Duane Nickull <duane@x...>
  • To: Jeff Greif <jgreif@a...>, xml-dev@l...
  • Date: Thu, 17 May 2001 06:09:42 -0700

punctuationmark
> I agree with your preferred way of writing the example, but not your
> rationale.  In English, 'currency' and 'type' are both nouns, not
> adjectives.  Referring to them as Adjectives seems confusing
>>>>>>>>>

In the context of how it was used in this thread,  "currency" was an
adjective for the "<Price>" element.

here is another example:

<MyXML version="1.0"/>

the ""version" attribute is used to describe something unique about the
element "MyXML".  It  is pointless to make version an element and use it by
itself when it is completely semantically meaningless unless you know what
it refers to.

<version>somecontent</version>

Sure - XML allows you to do everything 2 or 3 different ways and for most of
the time.  The preceding methods of chosing elements and attributes are what
I teach in my classes and what I hear many others teaaching as well.  They
are not the law.

Just as well,  you are free to model your XML to use mixed content or ....
<example>
<choice>or</choice>
<word>even</word>
<verb>use</verb>
<shortword>a</shortword>
<description>different</description>
<noun>element</noun>
<preposition>for</preposition>
<word>each</word>
<noun>word</noun>
<punctuationMark>.</punctuationMark>
</example>

Although I am sure someone can claim the latter is perfectly legal and make
a use case for it,  I personally would not recommend it as best practices.

So,  IMHO and not the opinions of all:

Element - use for nouns, items etc.
Attributes - used for associating something unique about an element (english
example = adjective).

My $0.02 (canadian) worth...

Duane Nickull


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.