when parsing xml, ( tag = <abcd/> ) XmlTextParser equals it to XmlNodeType.Element

Posted on 2009-05-06
Last Modified: 2013-11-11
but it really indicates both beginning and ending
( with no data in between )

not sure if i should use different API or may be
there are some nuances to this one ...


Dim textReader As XmlTextReader = New XmlTextReader    ' While textReader.Read()

   Dim nType As XmlNodeType = textReader.NodeType

   If nType = XmlNodeType.Element Then


   end if


Open in new window

Question by:AlexF777
  • 2
  • 2

Expert Comment

Comment Utility
<abcd /> is an Element.

Author Comment

Comment Utility
may be so, but normally in our files we receive a pair
of tags: <abcd></abcd>

if there was some way to differentiate <abcd/> element
it would really help

Author Comment

Comment Utility
Dim objXMLTextReader as XMLTextReader = new XmlTextReader("path")

if objXMLTextReader.IsEmptyElement then
   msgbox("now we know")
end if

Accepted Solution

RyanAndres earned 500 total points
Comment Utility
I'm not sure how you would do that since the xml parser reads them the same. You could check the childnode and attribute counts. if they are 0. Let me know if this is sufficient.

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now