1 2 3 4 5 6 7 8 9 10 11
| Dim navOptions As XPathNavigator = DataSources(strDataConnectionName).CreateNavigator().SelectSingleNode("//OPTIONS", NamespaceManager)
' Recherche du namespace
Dim myNameSpace As String = navOptions.GetNamespace("dfs")
Dim nsMgr As New XmlNamespaceManager(New NameTable())
nsMgr.AddNamespace("dfs", myNameSpace)
Dim xmlns As XNamespace = DirectCast(navOptions.GetNamespace("dfs"), XNamespace)
' Ajout d'un item dans la collection (en Linq : ajouter la réf : System.Xml.Linq)
Dim XOption As New XElement(New XElement(xmlns + "OPTION", New XElement(xmlns + "VALUE", itemid), New XElement(xmlns + "DISPLAYNAME", itemvalue)))
navOptions.AppendChild(XOption.ToString()) |