0

How do we get the display_value in this node?

assigned_to display_value="GROUP">sampletext</assigned_to> 

as my code xNode.NodeValue returns only this "sampletext"

sample code:

Public Sub LoadNodesIntoRs(ByRef nodes As MSXML2.IXMLDOMNodeList, rs AsADODB.Recordset, recordCount As Integer)

Dim xNode As MSXML2.IXMLDOMNode

Dim fieldIndex As Integer

For Each xNode In nodes
    If xNode.NodeType = NODE_TEXT Then

        Select Case xNode.ParentNode.nodeName
            Case "assigned_to"
                fieldIndex = 0

            Case "severity"
                fieldIndex = 1

            Case "urgency"
                fieldIndex = 2

        End Select

        rs(fieldIndex) = xNode.NodeValue


    End If

    If xNode.HasChildNodes Then
       'recurive call for the next node
      LoadNodesIntoRs xNode.ChildNodes, rs, recordCount
    End If

Next xNode

End Sub

Please help. Thank you.

gareching
  • 59
  • 1
  • 9

1 Answers1

0

Have in mind that "display_value" is not a node but an attribute.

xNode.Attributes.getNamedItem("display_value").Text

should get the value, see Looping through XML using VBA

Community
  • 1
  • 1
Andreas
  • 1,220
  • 8
  • 21
  • @gareching: Was this answer helpful? The game is to accept correct answers, so I suggest this to you. As I see you have asked two questions and haven't accepted any answer yet. – Andreas Sep 08 '15 at 05:55