OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Attributes v Elements [conclusions]



> 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