Solved

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

Posted on 2009-05-06
4
247 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
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…
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 …

696 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