xsd.exe does not handle default values for xs:decimal correctly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mono (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
when xsd.exe is used with the /c switch to generate c# code from an existing xml schema (.xsd), it handles attributes like the following incorrectly:
<xs:attribute name="setup" type="xs:decimal" default="123"/>
this will generate:
[System.
public decimal setup {
get {
}
set {
}
}
the important thing is the parameter for the DefaultValue constructor: '123m' is added without quotes. i am not entirely sure that it should actually be quoted, but if it is not then the compiler bails out with:
error CS0182: An attribute argument must be a constant expression, typeof expression or array creation expression
defaults for other types (e.g. integer) are quoted correctly.
this is with the latest mono stuff from 12.04
i.e. 2.10.8.1-1ubuntu1