Solved

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

Posted on 2009-05-06
4
243 Views
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 ...

-Alex

Dim textReader As XmlTextReader = New XmlTextReader    ' While textReader.Read()
   Dim nType As XmlNodeType = textReader.NodeType
   If nType = XmlNodeType.Element Then
      msgbox(textReader.Name.ToString)
   end if
wend

Open in new window

0
Comment
Question by:AlexF777
  • 2
  • 2
4 Comments
 
LVL 8

Expert Comment

by:RyanAndres
ID: 24318843
<abcd /> is an Element.
0
 

Author Comment

by:AlexF777
ID: 24325650
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
0
 

Author Comment

by:AlexF777
ID: 24349229
Dim objXMLTextReader as XMLTextReader = new XmlTextReader("path")

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

Accepted Solution

by:
RyanAndres earned 500 total points
ID: 24350022
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.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
This collection of functions covers all the normal rounding methods of just about any numeric value.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

803 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