XML Considered Harmful

Michael F. Stemper michael.stemper at gmail.com
Mon Sep 27 11:47:05 EDT 2021


On 25/09/2021 16.48, 2QdxY4RzWzUUiLuE at potatochowder.com wrote:
> On 2021-09-25 at 15:20:19 -0500,
> "Michael F. Stemper" <michael.stemper at gmail.com> wrote:
> 
>> ... For instance, if
>> I modeled a fuel like this:
>>
>>    <Fuel name="Montana Sub-Bituminous">
>>      <uom>ton</uom>
>>      <price>21.96</price>
>>      <heat_content>18.2</heat_content>
>>    </Fuel>
>>
>> and a generating unit like this:
>>
>>    <Generator name="Skunk Creek 1">
>>      <IHRcurve name="normal">
>>        <point P="63" IHR="8.513"/>
>>        <point P="105" IHR="8.907"/>
>>        <point P="241" IHR="9.411"/>
>>        <point P="455" IHR="10.202"/>
>>      </IHRcurve>
>>      <IHRcurve name="constrained">
>>        <point P="63" IHR="8.514"/>
>>        <point P="103" IHR="9.022"/>
>>        <point P="223" IHR="9.511"/>
>>        <point P="415" IHR="10.102"/>
>>      </IHRcurve>
>>    </Generator>
>>
>> why would the fact that I could have chosen, instead, to model
>> the unit of measure as an attribute of the fuel, or its name
>> as a sub-element matter? Once the modeling decision has been
>> made, all of the decisions that might have been would seem to
>> be irrelevant.
> 
> Disclaimer:  I am not a big XML fan, for a number of reasons
> already stated in this thread.
> 
> That said, please do include units in elements like heat_content,
> whether or not it's Joules/kilogram/K, and price, even if is the
> local currency in the only country to which your data applies.

Since the units (dimensions) don't matter as long as they're consistent
between heat_content and the IHR value (MBTU and MBTU/MWh or GJ and
GJ/MWh), I was initially going to ignore this suggestion. However, it
seems that if I added attributes for the unit of measure of heat, that
would allow checking that the data provided are indeed consistent.

Thanks for the suggestion.

With respect to currency, I've had customers (back when I had to work
for a living) use dollars, pesetas, Euros, and pounds. In of Wood and
Wollenberg[1], the authors use \cancel{R} to represent a generic
currency. But I might even add a currency attribute to the price
element.

> If there's a standard for your industry, or your company, or on
> some other level, then at least document what it is and that
> you're using it, so that the next person (which may be you a
> year from now) doesn't have to guess.

As far as power is concerned, this is utility-level generating fleets,
so it's always going to be MW -- even in the US, where we still use
BTUs for heat.



[1] _Power Generation, Operation, and Control; Allen J. Wood and Bruce
F. Wollenberg; (c) 1984, John Wiley & Sons.
-- 
Michael F. Stemper
The FAQ for rec.arts.sf.written is at
<http://leepers.us/evelyn/faqs/sf-written.htm>
Please read it before posting.


More information about the Python-list mailing list