forked from dotnet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsource.vb
33 lines (24 loc) · 823 Bytes
/
source.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
' <Snippet1>
Imports System.IO
Imports System.Xml
public class Sample
public shared sub Main()
Dim doc as XmlDocument = new XmlDocument()
doc.LoadXml("<book genre='novel' ISBN='1-861001-57-5'>" & _
"<title>Pride And Prejudice</title>" & _
"</book>")
'Create an attribute collection.
Dim attrColl as XmlAttributeCollection = doc.DocumentElement.Attributes
'Declare the array.
Dim array(1) as XmlAttribute
Dim index as integer=0
'Copy all the attributes into the array.
attrColl.CopyTo(array, index)
Console.WriteLine("Display all the attributes in the array...")
Dim attr as XmlAttribute
for each attr in array
Console.WriteLine("{0} = {1}",attr.Name,attr.Value)
next
end sub
end class
' </Snippet1>