[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A query in xml schema..
- From: Charles Reitzel <creitzel@mediaone.net>
- To: Venugopal Siripuram <svenu@wilco-int.com>
- Date: Mon, 07 May 2001 10:51:07 -0400
The basic problem is that you are depending on implicit sub-fields. This is not the best design approach in XML or databases. You generally want each data item (column, element, etc.) to represent one thing. So you'll want to split the currency and amount into separate data items.
How about:
<myValue currency="usd">11678.25</value>
or
<myValue currency="inr" amount="17372.53" />
In the schema, you could set the default value of currency to your preferred value. You could create an enumeration for currency values. I'd suggest the ISO 3 letter currency codes.
If you are receiving the data in combined form, it is better to parse it into parts as early as possible in the data flow. Preferably this should occur at data entry time so that errors in either the currency or amount may be corrected.
take it easy,
Charles Reitzel
At 05:17 PM 5/7/01 +0530, Venugopal Siripuram wrote:
>Hi all
> i want xml schema to validate a "cost" element where cost can be in
>dollars or in Rupees..
> That is, cost element can be any thing like this.. $11678.25 or
>Rs11678.25
> The values sucessed by "$" or "Rs" should be a double value not string
> for example $\d{1,10}.\d{1,2} does n`t work for me, bcoz, in that case the
>values sucessed by "$" or "Rs" are strings
> Please do write a solution if it exist..
>
>
> Many thanks in advance..
>
>
>
> Regards
>Venugopal Siripuram
>
>"There was never a night or problem that could defeat sunrise or hope".
>-Mahatma Gandhi
take it easy,
Charles Reitzel