Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xml-dev] can attribute in XML schema hold value and unit

From: "Sreeni Yetchina -X \(syetchin - Pure Solutions at Cisco\)" <syetchin@-----.--->
To: "Chiusano Joseph" <chiusano_joseph@---.--->, "Mangesh Kalbhor" <Mangesh.Kalbhor@--------.--->, <xml-dev@-----.---.--->
Date: 3/3/2006 9:11:00 PM
If I can remember correctly, I implemented the regular 
expression validation of Dates(like Feb28 etc) in the schemas(around 3 years 
back). There are bunch of code examples across the web for this. So, we can do 
validate the dates or for a given set of values- enumerated data (like days of a 
week) etc in the Regular expressions. 
 
The date format decides the validation regular expression 
expression(ex: Regular expression for dd-MMM-yyyy is diff from 
mm/dd/yyyy)
 
Thanks,
Sreeni
 



From: Chiusano Joseph 
[mailto:chiusano_joseph@b...] 
Sent: Friday, March 03, 2006 1:00 
PM
To: Sreeni Yetchina -X (syetchin - Pure Solutions at Cisco); 
Mangesh Kalbhor; xml-dev@l...
Subject: RE: [xml-dev] can 
attribute in XML schema hold value and unit



Regular expressions may work to some degree in this case, but they won't 
provide the level of validation for units that you need. For example, a regular 
expression can be used to define the format for a date, but it cannot validate 
that a date of (for example) February 30 is not present, as it cannot validate 
the combination of month and year in this case. 
 
So Len's example of an attribute for units, with an enumerated list of 
valid values, is the best approach.
 
Joe
 

Kind Regards,
Joseph Chiusano
Associate
Booz Allen Hamilton
 

700 13th St. NW, Suite 1100
Washington, DC 20005
O: 202-508-6514  
C: 202-251-0731

Visit us online@ http://www.boozallen.com
 



From: Sreeni Yetchina -X (syetchin - Pure 
Solutions at Cisco) [mailto:syetchin@c...] 
Sent: Friday, March 
03, 2006 3:27 PM
To: Mangesh Kalbhor; 
xml-dev@l...
Subject: RE: [xml-dev] can attribute in XML 
schema hold value and unit



Hi Mangesh,
You can have this in Schema.
Define simple type attribute and have a regular expression 
as the constraint on that simple type attribute according to your data+units 
combination.
-Sreeni



From: Mangesh Kalbhor 
[mailto:Mangesh.Kalbhor@a...] 
Sent: Friday, March 03, 2006 
12:08 PM
To: xml-dev@l...
Subject: [xml-dev] can 
attribute in XML schema hold value and unit




Hi All,<o:p></o:p>
<o:p> </o:p>
I am creating a xml schema where I 
have to making a ‘attribute’ but can a attribute hold a value and 
unit.<o:p></o:p>
My example is FlowRate, let’s the 
value and unit could be 100 GPM.<o:p></o:p>
Can I have just one attribute for 
100 and GPM both. Some times it might be 80 cFPS.<o:p></o:p>
<o:p> </o:p>
So can a attribute hold both or do I 
need element here.<o:p></o:p>
<o:p> </o:p>
Thanks,<o:p></o:p>
<o:p> </o:p>
Mangesh<o:p></o:p>


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent