 |
 |
 |
<FlowRate unitStuff="GPM 100" />
The
best answer is, don't do that; it's bad design for
reasons that are obvious (esentially, it is a token delimited
list
and has all the same problems of production order,
catching errors late, all strings, etc.)
Make
two attributes: one for unitType and one for unitValue.
<FlowRate
unitValue="100" unitType="GPM" />
It's clear and better for production and
validation.
If
these are basic types, say enumeration for the
unitTypes and numbers for the values, attributes will work
but
are the least extensible.
A FlowRate element with an enumerated
attribute for unit type.
<FlowRate unit="GPM">100</FlowRate>
Dealer's choice but the last one is the most robust.
len
-----Original Message-----
From: Mangesh Kalbhor
[mailto:Mangesh.Kalbhor@a...]
Sent: Friday, March 03, 2006
2: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>
|
 | 

|  |
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.
|  |
| |
 |
 |
 |