Convert It 2.2+ XML Schema Definitions


Catalogue.XML


Four Conversion Types are supported



  1. Measures: General Linear Conversions eg 1inch = 2.5 CMs etc
  2. Currency: Currency Definitions.  Categories of type "Currency" can be updated via the Currency Rate Web Service provided free of charge by http://www.webservicex.net. For valid Currency Symbols see www.xe.com - the 3 Character Symbols (eg GBP = United Kingdom Pounds) is a great list of valid currency symbols
  3. StockQuote:  Catgories of this type can be updated via the Stock Quote Web Service provided free of charge by http://www.webservicex.net.
  4. Temperature:  For the moment this category is used for Celsius <-> Fahrenheit and it's the only conversion supported and is hard coded as it requires a constant and for the moment the XML definition doesn't cater for this:-)

Categories Element Attributes.



  1. Default: Sets the default Conversion Category on application Startup
  2. CategoryCount: Must Equal the number of Category Elements defined in the document

<?xml version="1.0" encoding="utf-8" ?>
<
Categories Default="6" CategoryCount="12"
>
<
Category DisplayName="Angles" FileName="Angle" Type="Measures"
/>
<
Category DisplayName="Computer" FileName="Computer" Type="Measures"
/>
<
Category DisplayName="Length" FileName="Length" Type="Measures"
/>
<
Category DisplayName="Speed" FileName="Speed" Type="Measures"
/>
<
Category DisplayName="Weight Common" FileName="WeightAvoir" Type="Measures"
/>
<
Category DisplayName="Weight Troy" FileName="WeightTroy" Type="Measures"
/>
<
Category DisplayName="My Currencies" FileName="CurrencyMy" Type="Currency"
/>
<
Category DisplayName="Common Currencies" FileName="Currency" Type="Currency"
/>
<
Category DisplayName="All Currencies" FileName="CurrencyAll" Type="Currency"
/>
<
Category DisplayName="My Stocks" FileName="StocksMy" Type="StockQuote"
/>
<
Category DisplayName="Interesting Stocks" FileName="StocksInterest" Type="StockQuote"
/>
<
Category DisplayName="Temperature" FileName="Temperature" Type="Temperature"
/>
</
Categories>


 


Category Definitions


XML Definition is as follows:



  1. The first Element name must match the filename without the .XML Extension
  2. First Element Attributes

    1. BaseReference:  Defines the Base Reference for the conversion category
    2. ItemCount: Must match the number of items in the category
    3. DefaultItem: (optional: default="0") what is the default startup item for the category
    4. DataDate: (optional) used for Currency and StockQuote types to store the date the data was last updated
    5. Format: (optional: default="n6") Any valid .NET string format characters eg n2 = number with 2 decimal points
    6. Description: (optional) Displayed when a category selected and no value entered.  If not defined then the description name defaults to the name defined for the first element in the category

  3. Item Element Attributes

    1. Name: The name of the Category Item
    2. Value: Ratio relative to the Category BaseReference

 


Example Category Files


Length.XML


<?xml version="1.0"?>
<!--
All conversion ratios must be relative to the BaseReference element
-->
<!--
eg 1 Grams (BaseReference), 1000 Grams in a Kilo, 28.3495231 grams in a Ounce
-->
<!--
ItemCount = total number of item elements inc the BaseReference element
-->
<
Length BaseReference="0" ItemCount="12" Format="n4" Description="Length Measurements"
>
<
Item Name="Centimeters" Value="1"
/>
<
Item Name="Millimeters" Value="0.1"
/>
<
Item Name="Meters" Value="100"
/>
<
Item Name="Kilometers" Value="100000"
/>
<
Item Name="Inches" Value="2.54"
/>
<
Item Name="Feet" Value="30.48"
/>
<
Item Name="Yards" Value="91.44"
/>
<
Item Name="Rod:Pole:Perch" Value="502.9"
/>
<
Item Name="Miles:Statute" Value="160934.4"
/>
<
Item Name="Fathom" Value="182.9"
/>
<
Item Name="Cable" Value="18531.9"
/>
<
Item Name="Nautical Mile:International" Value="185200"
/>
</
Length>


CurrencyMY.XML


<?xml version="1.0"?>
<
CurrencyMy BaseReference="1" ItemCount="8" DefaultItem="0" DataDate="10/14/2005 22:20:38" Format="n4" Description="Frequently Used Currencies"
>
<
Item Name="USD" Value="0.8335"
/>
<
Item Name="EUR" Value="1"
/>
<
Item Name="GBP" Value="1.4591"
/>
<
Item Name="AUD" Value="0.6259"
/>
<
Item Name="CHF" Value="0.6448"
/>
<
Item Name="PHP" Value="0.0149"
/>
<
Item Name="PLN" Value="0.2542"
/>
<
Item Name="HKD" Value="0.1075"
/>
</
CurrencyMy>


StocksMy.XML


<?xml version="1.0"?>
<
StocksMy BaseReference="0" ItemCount="7" DefaultItem="0" DataDate="10/12/2005 23:52:40" Format="n4" Description="My Portfolio"
>
<
Item Name="Show-All" Value="0"
/>
<
Item Name="MSFT" Value="24.52" Info="O:24.41, H:24.55, V:3163640, PC:+0.45%, "
/>
<
Item Name="IBM" Value="82.5" Info="O:82.75, H:82.75, V:179000, PC:-0.83%, "
/>
<
Item Name="SUNW" Value="3.97" Info="O:3.98, H:3.993, V:975188, PC:-0.75%, "
/>
<
Item Name="NOVL" Value="7.17" Info="O:7.11, H:7.18, V:73719, PC:+0.14%, "
/>
<
Item Name="BT" Value="38.38" Info="O:38.38, H:38.38, V:1100, PC:0.00%, "
/>
<
Item Name="NAB" Value="120.5" Info="O:N/A, H:N/A, V:0, PC:0.00%, "
/>
</
StocksMy>


Temperature.XML


<?xml version="1.0"?>
<
Temperature BaseReference="0" ItemCount="2" Format="n2"
>
<
Item Name="Celsius" Value="0"
/>
<
Item Name="Fahrenheit" Value="0"
/>
</
Temperature>


 

Comments (0)

Skip to main content