Skip to content

XmlTextAttribute Support (Rudimentary) #192

Description

@justeff

It seems like that XmlTyp(AnonymousType = true) is not supported.

        public class ClassA
        {
            public string ElementA { get; set; } = "TextA";
            public ClassB B { get; set; } = new ClassB();
        }
        
        [XmlType(AnonymousType = true)]
        public class ClassB
        {
            public string ElementB { get; set; } = "TextB";
        }

I want to prevent <B><ElementB>TextB</ElementB></B> and just get <ElementB>TextB</ElementB> inside ClassA. Is there another way to achieve this? I have to say, I don't like the standard Xml Serializer solution, because if I need a class C which should have Class B fully inside and not just his members, then I have to create a duplicate class for B but without the "AnonymousType" tag, that's why I would favour a member tag like XmlElement to be more flexible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement(cc: feat) New feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions