N
Nick
I'm looking for any guidelines along the lines of XSD Best practices
for the following issues.
If you are modelling something like interest rates, there is a choice
of how you represent that interest rate. For example you could
represent an interest rate of 5.125% as "5.125", or you could represent
the rate as "0.05125".
Somewhere you need to have some information about what 'style' is being
used
One option is an attribute
<InterestRate representation="percentage">5.125</InterestRate>
or
<InterestRate representation="decimal">0.05125</InterestRate>
However this does give flexibility, but it does mean you have to
represent the style every time it is used.
I see that the alternative is to restrict to one choice, and move that
the schema as a comment.
Another option is to put out both choices all the time. Perhaps as
attributes.
<InterestRate decimal="0.05125" percentage="5.125"/>
Then there are the question of what I call domain values. For example,
there is an ISO standard for currencies. It is a three letter code. USD
for US dollars. GBP for pounds sterling,...
Here, you would want to make the codes a separate type, probably with a
pattern restriction and a comment about the representation being used.
Any comments in general about approaches to take to this part of schema
modelling?
Nick
for the following issues.
If you are modelling something like interest rates, there is a choice
of how you represent that interest rate. For example you could
represent an interest rate of 5.125% as "5.125", or you could represent
the rate as "0.05125".
Somewhere you need to have some information about what 'style' is being
used
One option is an attribute
<InterestRate representation="percentage">5.125</InterestRate>
or
<InterestRate representation="decimal">0.05125</InterestRate>
However this does give flexibility, but it does mean you have to
represent the style every time it is used.
I see that the alternative is to restrict to one choice, and move that
the schema as a comment.
Another option is to put out both choices all the time. Perhaps as
attributes.
<InterestRate decimal="0.05125" percentage="5.125"/>
Then there are the question of what I call domain values. For example,
there is an ISO standard for currencies. It is a three letter code. USD
for US dollars. GBP for pounds sterling,...
Here, you would want to make the codes a separate type, probably with a
pattern restriction and a comment about the representation being used.
Any comments in general about approaches to take to this part of schema
modelling?
Nick