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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
Dim xpathDoc As XPathDocument
Dim xmlNav As XPathNavigator
Dim xmlNI1 As XPathNodeIterator
Dim xmlNI2 As XPathNodeIterator
xpathDoc = New XPathDocument("C:\Documents and Settings\Mes documents\Visual Studio Projects\WindowsApplication1\bin\IXF_Data.xml")
xmlNav = xpathDoc.CreateNavigator()
xmlNI1 = xmlNav.Select("//*[contains(name(),':partNumber')]")
xmlNI2 = xmlNav.Select("//*[contains(name(),':partType')]")
Dim NombreComposant As Double
NombreComposant = xmlNI1.Count
MsgBox(NombreComposant)
Dim NombreType As Double
NombreType = xmlNI2.Count
MsgBox(NombreType)
Dim Tableau(NombreComposant, 3) As String
Dim i As Integer
Tableau(0, 0) = "N°"
Tableau(0, 1) = "Article"
Tableau(0, 2) = "Type d'article (language Smarteam)"
Tableau(0, 3) = "Type d'article (language Windchill)"
i = 0
While i < NombreComposant
Tableau(i, 0) = i
i = i + 1
End While
i = 1
While (xmlNI1.MoveNext())
System.Console.WriteLine(xmlNI1.Current.Name + " : " + xmlNI1.Current.Value)
Tableau(i, 1) = xmlNI1.Current.Value
i = i + 1
End While
i = 1
While (xmlNI2.MoveNext())
System.Console.WriteLine(xmlNI2.Current.Name + " : " + xmlNI2.Current.Value)
Tableau(i, 2) = xmlNI2.Current.Value
i = i + 1
End While
Dim TypeWindchill As String
i = 1
While (xmlNI2.MoveNext())
System.Console.WriteLine(xmlNI2.Current.Name + " : " + xmlNI2.Current.Value)
If xmlNI2.Current.Value = 0 Then
TypeWindchill = "separable"
Else
TypeWindchill = "component"
End If
Tableau(i, 3) = TypeWindchill
i = i + 1
End While
End
End Sub |
Partager