You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a XSD containing following entry: <xs:attribute name="version" type="xs:normalizedString" use="required" fixed="0500"/>
The xsd.exe initializes the value in the constructor with 0500, so that the user does not have to deal with it. It would be great, if you could add this too!
This is the patch I used to achieve a similar code generation. You might have to check if it's wanted that the FixedValue is used as DefaultValue in cases where the attribute is optional. The xsd.exe does not check this and always uses the FixedValue when no DefaultValue is given.
Thanks, I made it so that when the element/attribute is optional, the default value is not set. You could take this further e.g. by hardcoding the fixed value in the setter or not generating a setter at all when the element/attribute is not optional, but for now I've kept it simple. This means that you can set a different value than the fixed one.
I have a XSD containing following entry:
<xs:attribute name="version" type="xs:normalizedString" use="required" fixed="0500"/>
The xsd.exe initializes the value in the constructor with 0500, so that the user does not have to deal with it. It would be great, if you could add this too!
This is the patch I used to achieve a similar code generation. You might have to check if it's wanted that the FixedValue is used as DefaultValue in cases where the attribute is optional. The xsd.exe does not check this and always uses the FixedValue when no DefaultValue is given.
The text was updated successfully, but these errors were encountered: