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

Re: A query in xml schema..

  • From: Charles Reitzel <creitzel@m...>
  • To: Venugopal Siripuram <svenu@w...>
  • Date: Mon, 07 May 2001 10:51:07 -0400

query in xml
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



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.