IsEmptyElement missing an Empty Tag.

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Here is the piece of xml which my tool uses for its purpose
<br/>
<Children><br/>
- <GUIObject xsi:type="GUIObject" ID="24 <br/>
<space>abc.xml</space> <br/>
<description /> <br/>
<ObjectTypeKey>window</GUIObjectTypeKey> <br/>
<properties>#32770;</properties> <br/>
<parent>23</parent> <br/>
- <Children>
In the about there is an empty tag <description /><br/>
My code is missing this empty tag from being accounted.<br/>
My code for reading XML is someting like below.
while (reader.Read())<br/>
{<br/>

<br/>

<br/>
switch (reader.NodeType)<br/>
{<br/>
case XmlNodeType.Element:<br/>
if (reader.IsEmptyElement)<br/>
{
//DOing something
}<br/>
else<br/>
{<br/>
<br/>
//DOing something
}<br/>
}}
Any idea as to why IsEmptyElement method missing this?
There are other empty tags such as <Children />, <properties /> which are being read by IsEmptyElement<br/>
I have no idea why its being skipped! The logic which I have used is good. For me there is no reason
<br/>
as to why its missing the <description /> tag.

View the full article
 
Back
Top