Read XML from VB.NET [modified]
-
Hello, I am trying to read the attached XML file by entering the and return the value for Access Allowed List. I have worked with reading simple XML elements but have not worked with atributes and the like. I am also new to both XML and Dev in general. I have read several articles but most give me examples for reading simple XML e.g. John Smith The file I am trying to read is below, any help would be great and examples are very much welcome. My goal for the GUI in VB.NET will be to have a textbox to enter string number I am searching for and a dropdown but to select the language. Regards Jason Access Allowed List Access Allowed List Access Allowed List Access Allowed List Access Allowed List Access Allowed List Lista de accesos permitidos Pääsylista sallitut Liste des accès autorisés Access Allowed List Hozzáférés Engedély Lista Elenco accessi consentiti Access Allowed List Liste over systemtilgang Access Allowed List Access Allowed List Använda tillÃ¥ten lista المطبوعة: Vytisknuto: Gedruckt: Printed: Prinditud: Printed: Impreso: Tulostettu: Imprimé: Printed: Nyomtatott: Printed: Stampato: Afgedrukt: Skrevet ut Wydrukowano: Ðапечатано: Utskrivet:
When people make you see red, be thankful your not colour blind. modified on Thursday, September 11, 2008 8:47 AM
-
Hello, I am trying to read the attached XML file by entering the and return the value for Access Allowed List. I have worked with reading simple XML elements but have not worked with atributes and the like. I am also new to both XML and Dev in general. I have read several articles but most give me examples for reading simple XML e.g. John Smith The file I am trying to read is below, any help would be great and examples are very much welcome. My goal for the GUI in VB.NET will be to have a textbox to enter string number I am searching for and a dropdown but to select the language. Regards Jason Access Allowed List Access Allowed List Access Allowed List Access Allowed List Access Allowed List Access Allowed List Lista de accesos permitidos Pääsylista sallitut Liste des accès autorisés Access Allowed List Hozzáférés Engedély Lista Elenco accessi consentiti Access Allowed List Liste over systemtilgang Access Allowed List Access Allowed List Använda tillÃ¥ten lista المطبوعة: Vytisknuto: Gedruckt: Printed: Prinditud: Printed: Impreso: Tulostettu: Imprimé: Printed: Nyomtatott: Printed: Stampato: Afgedrukt: Skrevet ut Wydrukowano: Ðапечатано: Utskrivet:
When people make you see red, be thankful your not colour blind. modified on Thursday, September 11, 2008 8:47 AM
Hello, OK I have worked out the below code to return the 'EN' string if I supply the string code, say "1000". What I need to know is understand how to search for the string and return the string code. If I would use a wildcard in this it would be great. Any Thoughts??? Private Sub XPathSearch(ByVal XMLPath As String) Dim xmlNI As XPathNodeIterator Dim xpathDoc As XPathDocument Dim xmlNav As XPathNavigator Try xpathDoc = New XPathDocument(XMLPath) xmlNav = xpathDoc.CreateNavigator() xmlNI = xmlNav.Select("/MOMLANG/STRING[@code='" & stringValue & "']/LANG[@code='EN']") While (xmlNI.MoveNext()) 'Me.RichTextBox1.AppendText(xmlNI.Current.Name + " : " + xmlNI.Current.Value & vbCrLf) Me.RichTextBox1.AppendText("String value: " + xmlNI.Current.Value & vbCrLf) End While Catch ex As XPathException System.Console.WriteLine("XMLException: " + ex.Message) Catch ex As Exception System.Console.WriteLine("Exception: " + ex.Message) End Try End Sub When people make you see red, be thankful your not colour blind.