Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Inner Implicit Child List Content Supported via XmlElementAttribute? #501

Closed
BianChengNan opened this issue Mar 3, 2021 · 3 comments
Closed
Labels
known issue An identified defect, usually one that is significant and not easily fixed. question Further information is requested system.xml.serialization Classic serialization issue (probably won't be fixed)

Comments

@BianChengNan
Copy link

As #243 has been closed. I think I'd better create a new one. sorry for interrupt.

Does ExtendedXml|Serializer support serialize/deserialize such xml structures now? really need this feature.

<MediaContainer size='1'> 
    <MediaItem Name='Name1' Id='1' />
    <MediaItem Name='Name2' Id='2' />
</MediaContainer>

public class MediaContainer
{
    [XmlAttribute("size")]
    public int Size { get; set; }

    [XmlElement("MediaItem")]
    public List<MediaItem> Items { get; set; }
}

public class MediaItem
{
    [XmlAttribute]
    public string Name { get; set; }

    [XmlAttribute]
    public string Id { get; set; }
}
@Mike-E-angelo Mike-E-angelo added question Further information is requested system.xml.serialization Classic serialization issue (probably won't be fixed) known issue An identified defect, usually one that is significant and not easily fixed. labels Mar 3, 2021
@Mike-E-angelo
Copy link
Member

Hi @BianChengNan thank you for writing in with your question here. Unfortunately, this is related to a known issue specifically #461 which among other problems does not fully respect implicit inner content of an XmlElementAttribute for list items.

As this project is essentially in maintenance mode, the recommendation now is the same as it is in #243: use XSLT. I acknowledge this is less than ideal and a pain, but it will allow you to cater to both legacy/classic serializer documents while still being able to use ExtendedXmlSerializer.

If you have any further questions around this scenario please do let me know and I will do my best to assist you.

@Mike-E-angelo Mike-E-angelo changed the title Ask for feature Is Inner Implicit Child List Content Supported via XmlElementAttribute? Mar 4, 2021
@BianChengNan
Copy link
Author

Hi @BianChengNan thank you for writing in with your question here. Unfortunately, this is related to a known issue specifically #461 which among other problems does not fully respect implicit inner content of an XmlElementAttribute for list items.

As this project is essentially in maintenance mode, the recommendation now is the same as it is in #243: use XSLT. I acknowledge this is less than ideal and a pain, but it will allow you to cater to both legacy/classic serializer documents while still being able to use ExtendedXmlSerializer.

If you have any further questions around this scenario please do let me know and I will do my best to assist you.

copy that, thanks for your reply. really appreciate for your hard work and this excellent project.

@Mike-E-angelo
Copy link
Member

Thank you very much for the kind words, @BianChengNan. It is much appreciated. 🙏 Please do let me know if you have any further questions (either posting here or a new issue) and I will do my best to assist. Closing this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
known issue An identified defect, usually one that is significant and not easily fixed. question Further information is requested system.xml.serialization Classic serialization issue (probably won't be fixed)
Projects
None yet
Development

No branches or pull requests

2 participants