Duke49
Messages postés552Date d'inscriptionjeudi 12 octobre 2006StatutNon membreDernière intervention24 janvier 2023
-
28 oct. 2010 à 12:22
cs_casy
Messages postés7741Date d'inscriptionmercredi 1 septembre 2004StatutMembreDernière intervention24 septembre 2014
-
28 oct. 2010 à 13:40
Merci d'avance, je sèche !
Erreur 1
La variable 'rtNode' masque une variable dans un bloc englobant.
Friend Function GetRootValue(ByVal strRoot As String) As String
Dim rtRootNode, rtNode, rtNode2 As Xml.XmlNode
For Each rtRootNode In xmlDOC.DocumentElement
If rtRootNode.LocalName = strRoot Then
Dim arRoot As String() = strRoot.Split("/")
Dim i As Integer
For i = 1 To arRoot.Length - 1
For Each rtNode As Xml.XmlNode In rtRootNode.ChildNodes
If rtNode.LocalName = arRoot(i) Then
Return rtNode
Exit Function
End If
Next
Next
Return rtRootNode.ChildNodes.Item(0).Value
End If
Next
Return Nothing
End Function
Duke49
Messages postés552Date d'inscriptionjeudi 12 octobre 2006StatutNon membreDernière intervention24 janvier 20234 28 oct. 2010 à 13:14
Là c top ^^
Friend Function GetValue(ByVal strRoot As String, ByVal ValueType As Xml.XmlNodeType) As String
Dim rtRootNode As Xml.XmlNode
Dim rtSubRoot As Xml.XmlNode
rtSubRoot = xmlDOC.SelectSingleNode(strRoot)
For Each rtRootNode In rtSubRoot.ChildNodes
If rtRootNode.NodeType = ValueType Then
Return rtRootNode.Value
End If
Next
Return Nothing
End Function
Duke49
Messages postés552Date d'inscriptionjeudi 12 octobre 2006StatutNon membreDernière intervention24 janvier 20234 28 oct. 2010 à 13:12
Pourquoi ce casser la tête MOAUahaha ^^ looky:
Friend Function GetValue(ByVal strRoot As String, ByVal ValueType As Xml.XmlNodeType) As String
Dim rtRootNode As Xml.XmlNode
Dim rtSubRoot As Xml.XmlNode
Dim arRoot As String() = strRoot.Split("/")
Dim id As Integer
rtSubRoot = xmlDOC.SelectSingleNode(strRoot)
For Each rtRootNode In rtSubRoot.ChildNodes ' xmlDOC.DocumentElement(rtSubRoot.LocalName)
If rtRootNode.NodeType = ValueType Then
Return rtRootNode.Value
End If
Next
Return Nothing
End Function