Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

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

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
AlexF777
Asked:
AlexF777
  • 2
  • 2
1 Solution
 
RyanAndresCommented:
<abcd /> is an Element.
0
 
AlexF777Author Commented:
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
 
AlexF777Author Commented:
Dim objXMLTextReader as XMLTextReader = new XmlTextReader("path")

if objXMLTextReader.IsEmptyElement then
   msgbox("now we know")
end if
0
 
RyanAndresCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now