Search code examples
c#xml-deserializationxmltextreader

Can XmlTextReader tell the difference between <tag> and <tag />


I am reading an XML file using an XMLTextReader. Is there a way to tell the difference between a start tag (like <tag>) and a self-terminating tag (like <tag />)


Solution

  • Use IsEmptyElement property