[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How to represent a "cost" in XML?

  • From: Mukul Gandhi <gandhi.mukul@gmail.com>
  • To: "Costello, Roger L." <costello@mitre.org>
  • Date: Thu, 27 Sep 2018 11:30:53 +0530

Re:  How to represent a "cost" in XML?
Dear Roger,
   I find both of following ok.

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

or 

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

(these are my personal preferences)

I also need to look at Ken's suggestions!

On Thu, Sep 27, 2018 at 3:14 AM 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



--
Regards,
Mukul Gandhi


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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.