-
Notifications
You must be signed in to change notification settings - Fork 200
Open
Description
I've got an XSD with these lines in it:
…
<xs:element name="PROC-IDENT" type="xs:string" fixed="0013"/>
<xs:element name="PROC-FUNC" type="xs:string" fixed="01"/>
…
This generates:
[XmlIgnoreAttribute()]
private string procIdent = "0013";
[RequiredAttribute(AllowEmptyStrings=true)]
[XmlElementAttribute("PROC-IDENT", Form=XmlSchemaForm.Unqualified)]
public string ProcIdent
{
get
{
return procIdent;
}
set
{
procIdent = value;
}
}
[XmlIgnoreAttribute()]
private string procFunc = "01";
[RequiredAttribute(AllowEmptyStrings=true)]
[XmlElementAttribute("PROC-FUNC", Form=XmlSchemaForm.Unqualified)]
public string ProcFunc
{
get
{
return procFunc;
}
set
{
procFunc = value;
}
}
Whereas I would expect it to generate:
[RequiredAttribute()]
[XmlElementAttribute("PROC-IDENT", Form=XmlSchemaForm.Unqualified)]
public string ProcIdent { get; } = "0013";
[RequiredAttribute()]
[XmlElementAttribute("PROC-FUNC", Form=XmlSchemaForm.Unqualified)]
public string ProcFunc { get; } = "01";
Or if necessary for compatibility reasons, I'd expect it to generate:
[RequiredAttribute()]
[XmlElementAttribute("PROC-IDENT", Form=XmlSchemaForm.Unqualified)]
public string ProcIdent { get => "0013"; set { } }
[RequiredAttribute()]
[XmlElementAttribute("PROC-FUNC", Form=XmlSchemaForm.Unqualified)]
public string ProcFunc { get => "01"; set { } }
Is this caused by an error of mine, or is the fault on xscgen's side?
Metadata
Metadata
Assignees
Labels
No labels