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?B?UkU6IFt4bWwtZGV2XSBEb27igJl0IGNyZWF0ZSBlbGVtZW50cyB3aXRoIHNp?==?utf-8?Q?mple_content_and_attributes?=

Hi Stephen,

 

  • Why not this then?
  • <Cost currency="USD"><Amount>8.95</Amount></Cost>

 

That design is good. Each item of data (USD and 8.95) is explicitly labeled. There is no anonymous/unlabeled data. It is consistent with the fundamental axiom of XML.

 

My opinion …

 

/Roger

 

From: Stephen D Green <stephengreenubl@gmail.com>
Sent: Thursday, September 27, 2018 9:16 AM
To: Costello, Roger L. <costello@mitre.org>
Cc: xml-dev@lists.xml.org
Subject: Re: [xml-dev] Don’t create elements with simple content and attributes

 

Why not this then?

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

Or

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

 

 


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

Hi Folks,

I hold this to be the fundamental axiom of XML:

          Make the structure of data explicit.

We accomplish that by adding a label (markup) to the data.

There are various terms for this notion of making the structure of data explicit: upconversion and uptranslation.

Elements with simple content and attributes are antithetical to the fundamental axiom of XML.

Here is an element with simple content and an attribute:

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

 

The data USD is explicitly labeled. The label indicates that USD is a currency.

What about the data 8.95, is it labeled? No! It is anonymous/unlabeled. Note: Cost is not the label for 8.95; Cost is the label for the whole package.

In my most recent post, I asked, “What is that number (8.95)?” I received excellent responses: 8.95 is a price, 8.95 is an amount, etc. External knowledge was needed to label the data. The need for external knowledge completely contradicts the fundamental axiom of XML.

Therefore, don’t create XML like this:

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

instead, create XML like this:

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

 

Do you agree?

 

/Roger

 



--

----

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