Re: [xml-dev] Don’t create elements with simple content and attributes

From
David Carlisle <>
To
"Costello, Roger L." <>
Date
2018-09-27T15:06:49Z
ID
<CAEW6iOiEnNjw6gVUT00m6A2=>
Thread
Re: [xml-dev] Don’t create elements with simple content and attributes
On Thu, 27 Sep 2018 at 13:54, Costello, Roger L. <> 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?


No.

David

>
>
>
> /Roger
>
>