Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the currently read XmlNode object?

Status
Not open for further replies.

IlyaRabyy

Programmer
Nov 9, 2010
572
US
Colleagues,
As usual, I couldn't find the answer to the question in subject in the MS Documentation (they associate the XmlNode objects with XmlDocument, not with XmlReader).
When I have the XmlReader read the next node, how do I get the node itself?
Here's the code I have now:
Code:
Do While loXMLReader.Read()
      lsXMLNodeContents = lsEndTag = ""

'[b][COLOR=#CC0000]What code should be here (provided I have declared loXMLNode As XmlNode before the Do While cycle)?[/color][/b]

      If XmlNode.HasChildNodes Then
         lsBuffer = lsBuffer & "Node " & Chr(34) & loXMLReader.Name & Chr(34) & " has children, written As-Is" & vbCrLf
         lcHdrStr = lcHdrStr & "<" & loXMLReader.Name & ">" & vbCrLf & IIf(tlFormat, vbCrLf, "")
         loStreamWriter.Write(lcHdrStr)
         Continue Do
      End If
[indent][indent]'some other codes, that sorts amd modifies the contents of a node just read[/indent][/indent]
Loop 'While loXMLReader.Read()

TIA!

Regards,

Ilya
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top