Solved

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

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
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…

914 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

17 Experts available now in Live!

Get 1:1 Help Now