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]
Re: [xml-dev] How to represent a "cost" in XML?

And just to add - the Amount might not have the same name subject as currency - it could be that two amounts called XyzAmount and ZyxAmount both have the same currency code AbcCurrencyCode where Xyz and Zyx are subclasses of Abc.

<SomeSortOfDataSet>
...
<XyzAmount>123.45</XyzAmount>
...
<ZyxAmount>123.45</ZyxAmount>
...
<AbcCurrencyCode>USD</AbcCurrencyCode>
...
</SomeSortOfDataSet>

For example Abc might be the payment cost and Xyz and Zyx might be card payment cost and cash payment cost respectively both of which must be made in USD.

Regards
Stephen D Green


On Thursday, 27 September 2018, Stephen D Green <stephengreenubl@gmail.com> wrote:
Another XML representation based on typical data designs in financial systems is

<SomeSortOfDataSet>
...
<XyzAmount>123.45</XyzAmount>
...
<XyzCurrencyCode>USD</XyzCurrencyCode>
...
</SomeSortOfDataSet>

This has the advantage that the amount and currency can be positioned at different places in the data or document.

Regards
Stephen D Green


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

Hi Folks,

 

I would like to represent in XML the cost of something.

 

Here’s one way to represent it:

 

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

 

If you didn’t want to use attributes (or mixed content), how would you represent it?

 

Would you represent it like this:

 

<Cost>
   
<Currency>USD</Currency>
   
<Value>8.95</Value>
</Cost>

 

I do not like that representation because it introduces a fake <Value> element.

 

Perhaps you would represent it by turning things inside out:

 

<Value>
   
<Currency>USD</Currency>
   
<Cost>8.95</Cost>
</Value>

 

I’m not sure I even know what that means.

 

Sigh.

 

Any economists out there? Please do tell: what is “cost”?

 

Cost seems to have (at least) two components: a number and an indication of what system of money the number is based on. The “system of money” is the currency. What about the number; what is it? What label do you give to the number? When you talk about the number, what words do you use?

 

/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