[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Attributes v Elements [conclusions]
- From: Duane Nickull <email@example.com>
- To: Jeff Greif <firstname.lastname@example.org>, email@example.com
- Date: Thu, 17 May 2001 06:09:42 -0700
> 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:
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.
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 ....
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...