question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XmlTextAttribute Support (Rudimentary)

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
Mike-E-angelocommented, Aug 16, 2018

Holy moly! Have I been in a rabbit hole. I am just now getting my environment back online and being able to attend to this. I hope to have this resolved today or tomorrow. We’ll see how I do. 😛

1reaction
justeffcommented, Aug 8, 2018

Thank you Mike, you don’t need to hurry up, I’ll use XmlSerializer to get my stuff done and maybe I can switch to this framework later on and benefit from peformance gains 😃 Have a good day.

Read more comments on GitHub >

github_iconTop Results From Across the Web

XmlTextAttribute Support (Rudimentary) · Issue #192
It seems like that XmlTyp(AnonymousType = true) is not supported. public class ClassA { public string ... XmlTextAttribute Support (Rudimentary) #192.
Read more >
XmlTextAttribute Class (System.Xml.Serialization)
Indicates to the XmlSerializer that the member must be treated as XML text when the class that contains it is serialized or deserialized....
Read more >
ProcessAttributes - Maple Help
The Allowable argument is a set of those attribute names, which are valid for xmlTree. •. ProcessAttributes can also perform rudimentary error checking...
Read more >
Software – a geek trapped in a cool guy's body - Jason Kemp
One of the big things Microsoft has said about .NET, and it's true, is that it has built-in support for XML. There is...
Read more >
The Intrusion Detection Message Exchange Format (IDMEF)
The XML standard requires support for both the UTF-8 and UTF-16 encodings of ISO/ ... The use of <AnalyzerTime> to perform rudimentary time...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found