XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
=?UTF-8?Q?Re=3A_=5Bxml=2Ddev=5D_Don=E2=80=99t_create_elements_with_simple_co?==?UTF-8?Q?ntent_and_attributes?=

Or are you saying the attribute is labelling the wrong thing - the element rather than what needs the label which is the content?

I guess if the Cost were extended with child elements then the attribute name would lose the specificity of what it is labelling.

On Friday, 28 September 2018, Stephen D Green <stephengreenubl@gmail.com> wrote:
Hi Roger

Why in your philosophy is an element name a label but an attribute name not a label?

Regards
Stephen D Green


On Friday, 28 September 2018, Costello, Roger L. <costello@mitre.org> wrote:

Hi Folks,

 

Thank you for the excellent replies.

 

Based on the replies, I see that I did a poor job explaining my position. Let me try again, please.

 

I am not arguing against attributes.

 

I am arguing against unlabeled data.

 

All of the following forms are good because they explicitly label the two pieces of data (USD and 8.95):

 

<Cost>
   
<Currency>USD</Currency>
   
<Amount>8.95</Amount>
</Cost>

<Cost currency="USD" amount="8.95" />

<Cost currency="USD">
   
<Amount>8.95</Amount>
</Cost>

<Cost amount="8.95">
   
<Currency>USD</Currency>
</Cost>

 

It matters not whether the label is in the form of an attribute or an element.

 

I am arguing that the following is bad because one piece of data (8.95) is not explicitly labeled:

 

<Cost currency="USD">8.95</Cost>

 

You might argue that 8.95 is labeled and the label is Cost. I disagree. I argue that Cost applies to the entire element (including the currency attribute); it does not specifically apply to 8.95.

 

As a result of the absence of an explicit label for 8.95, it is impossible to convert that form to an element-only form without human intervention. For example, a couple days ago one human suggested that 8.95 be labeled with “Amount” like so:

 

<Cost>
   
<Currency>USD</Currency>
   
<Amount>8.95</Amount>
</Cost>

 

This need to get humans involved to convert to an element-only form is bad, I argue.

 

Comments?

 

/Roger

 



--
----
Stephen D Green



--
----
Stephen D Green



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS