I am parsing some older XML Data which does not contain self closing elements.
All the elements have end-elements as well
<my-element someValue="xyz"></my-element> <!-- instead of <my-element someValue"xyz" /> --> When I parse the file with XMLReader in C#, the reader does an extra .Read() for any "empty content" within start-tag and end-tag.
When I add the contest to a list, I always get the wanted content, and an empty content added to my list.
I could get over the problem by calling
reader.Skip(); manually in the end of my loop, but that's rather hacky if i would come across some data files which DO containt self closing tags.
How can I tell the reader to skip all empty elements?
No comments:
Post a Comment