1

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 />)

Oded
  • 489,969
  • 99
  • 883
  • 1,009
jamesatha
  • 7,280
  • 14
  • 37
  • 54

2 Answers2

2

If you mean the difference between <tag></tag> and <tag />, then the answer is no, as both are equivalent in XML, and you should not depend on this in your code.

Frank
  • 2,628
  • 15
  • 14
1

Use IsEmptyElement property

desco
  • 16,642
  • 1
  • 45
  • 56