1

Hello all i have an xml like this

<root>
<page key"page1.aspx" value="page1" />
<page key"page2.aspx" value="cookepage" >
</root>

now what i want to get is i want key and value attributes at the same time as i want them to add into a NameValueCollection

like this

NVC.Add(key,value)

untill now i have done this

 For Each Item as XmlNode In xdoc.SelectNodes("//*/@*")
' But this returns me only key or value attribute at a time and i can not add it to NVC
 Next

looking for a good suggestion

Adils Adils
  • 241
  • 1
  • 11

1 Answers1

1

select the page nodes.

then for each node, loop over attributes.

if attrib.Name='key' then ... elseif attrib.Name='value' then ... end if.

See: https://stackoverflow.com/a/933698/1043824

Community
  • 1
  • 1
inquisitive
  • 3,469
  • 2
  • 19
  • 46