resulta que ya lo se leer.
pero me presenta un problema cuando desea leer los keywords.
dejo el code y el archivo xml como lo tengo
Archivo XML
Código
<?xml version="1.0" encoding="utf-8"?> <Languaje> <Scopes> <Scope start="Namespace" End="End Namespace"/> <Scope start="#Region" End="#End Region"/> <Scope start="Class" End="End Class"/> <Scope start="Module" End="End Module"/> <Scope start="Interface" End="End Iterface"/> <Scope start="Sub" End="End Sub"/> <Scope start="Function" End="End Function"/> <Scope start="Property" End="End Property"/> <Scope start="Get" End="End Get"/> <Scope start="Set" End="End Set"/> </Scopes> <Coments> <Coment start="'" End="\n"/> </Coments> <Constants> <Constant text="VbCr"/> <Constant text="VbCrLf"/> <Constant text="VbLf"/> </Constants> <Operators> <Pattern Id="." /> <Pattern Id="!" /> <Pattern Id=":" /> <Pattern Id="^" /> <Pattern Id="*" /> <Pattern Id="/" /> <Pattern Id="+" /> <Pattern Id="-" /> <Pattern Id="=" /> <Pattern Id=";" /> <Pattern Id="|" /> <Pattern Id="\" /> <Pattern Id=">" /> <Pattern Id="<" /> </Operators> <Keys></Keys> <Keywords>AddHandler AddressOf Alias And AndAlso Ansi As Assembly Auto Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType Currency Date Decimal Declare Default Delegate Dim DirectCast Do Double Each Else ElseIf End Enum Erase Error Event Exit Explicit False Finally For Friend Function Get GetType GoTo Global Handles If Imports In Inherits Integer Interface Implements Is Let Lib Like Long Loop Me Mod Module MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing NotInheritable NotOverridable Object On Option Optional Or OrElse Overloads Overridable Overrides ParamArray Preserve Private Property Protected Public RaiseEvent ReadOnly ReDim RemoveHandler Resume Return Select Set Shadows Shared Short Single Static Step Stop String Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until Variant When While With WithEvents WriteOnly Xor</Keywords> </Languaje>
Codigo que uso para leerlo
Código
''' <summary> ''' Leer todas palabras claves del lenguaje ''' </summary> Public Sub LoadSintax(ByVal pathSystem As String, ByVal nomLanguaje As String) Dim Xml As XmlDocument Dim NodeList As XmlNodeList Dim Node As XmlNode Try Xml = New XmlDocument() Xml.Load(pathSystem & "\" & nomLanguaje & ".xml") 'Cargar el archivo XML con la info del lenguaje NodeList = Xml.SelectNodes("/Languaje/Scopes/Scope") 'Cargar los nodos a leer For Each Node In NodeList 'repetir hasta terminar todos los nodos With Node.Attributes sintax.StartMethod.Add(.GetNamedItem("start").Value) sintax.EndMethod.Add(.GetNamedItem("End").Value) End With Next NodeList = Xml.SelectNodes("/Languaje/Coments/Coment") 'Cargar el sistema de comentarios For Each Node In NodeList With Node.Attributes sintax.startComent.Add(.GetNamedItem("start").Value) sintax.endComent.Add(.GetNamedItem("End").Value) End With Next NodeList = Xml.SelectNodes("/Languaje/Constants/Constant") 'Cargar las constantes de la aplicacion For Each Node In NodeList With Node.Attributes sintax.Constants.Add(.GetNamedItem("text").Value) End With Next NodeList = Xml.SelectNodes("/Languaje/Operators/Pattern") 'Cargar los operadores del lenguaje For Each Node In NodeList With Node.Attributes sintax.Operators.Add(.GetNamedItem("Id").Value) End With Next Node = Xml.SelectSingleNode("/Languaje/Keywords") 'Cargar la sintaxis de lenguaje Dim strNode() As String = Split(Node.Value, " ") For idx = 0 To strNode.Length - 1 sintax.Sintaxis.Add(strNode(idx)) Next Node = Xml.SelectSingleNode("/Languaje/Keys") 'Cargar las palabras clave del lenguaje strNode = Split(Node.Value, " ") For idx = 0 To strNode.Length - 1 sintax.KeySintax.Add(strNode(idx)) Next Catch ex As Exception MsgBox(ex.GetType.ToString & vbNewLine & ex.Message.ToString, vbCritical, "ERROR!") End Try End Sub
que tengo mal o que tengo que cambiar para que me lea los keyword y los keys