You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to process some XML input which has HTML code in some tags. For these tags I want the raw content to process it later. I followed this answer on Stackoverflow and used XmlElement as member which works fine in most cases. The only problem I'm facing are self closing tags.
Self-closing tags are not valid Xml. Thus, XmlSerializer does not know how to handle them. If you need to embed html inside an xml document, you will need to Xml-Encode the html or wrap it in CData.
Self-closing tags are not valid Xml. Thus, XmlSerializer does not know how to handle them. If you need to embed html inside an xml document, you will need to Xml-Encode the html or wrap it in CData.
What the OP actually means is an empty-element tag as per syntax rule [44], section 3.1 of the XML 1.1 Specification. It is clear from the example provided.
It actually is a bug in XmlSerializer and/or the underlying infrastructure.
Activity
StephenMolloy commentedon Feb 16, 2023
Self-closing tags are not valid Xml. Thus, XmlSerializer does not know how to handle them. If you need to embed html inside an xml document, you will need to Xml-Encode the html or wrap it in CData.
ondrejtucny commentedon Feb 17, 2023
What the OP actually means is an empty-element tag as per syntax rule [44], section 3.1 of the XML 1.1 Specification. It is clear from the example provided.
It actually is a bug in XmlSerializer and/or the underlying infrastructure.
[-]XML deserialize self closing raw element[/-][+]XML deserialize raw empty-element[/+]