We help IT Professionals succeed at work.

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

297 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

Comment
Watch Question

<abcd /> is an Element.

Author

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

Author

Commented:
Dim objXMLTextReader as XMLTextReader = new XmlTextReader("path")

if objXMLTextReader.IsEmptyElement then
   msgbox("now we know")
end if
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.