Skip to content

Attributes with - symbol are not generated #552

@gunhasiz

Description

@gunhasiz

``I've recently using your XmlSchemcaClassGenerator tool and it seems that attributes which contains - characted in name, are not generated in final XML.

For example for attribute:
<xs:attribute name="ID-CLASS" type="xs:NMTOKEN" fixed="NAME"/>

Is there any solutions to this or is it a bug?

@edit

Actually it's different issue.
Because of default value of attribute with fixed="NAME", XSCGen generates this:

[System.Xml.Serialization.XmlIgnoreAttribute()]
private string _idclass = "NAME";

[System.ComponentModel.DefaultValueAttribute("NAME")]
[System.Xml.Serialization.XmlAttributeAttribute("ID-CLASS")]
public string Idclass
    {
        get
        {
            return _idclass;
        }
        set
        {
            _idclass = value;
        }
    }

where deleting [System.ComponentModel.DefaultValueAttribute("NAME")] solves my problem.
Why it's handled this way? How can this be solved?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions