how to create a hierarchical datastructure just like xml using .net?
i want to crate a hi开发者_运维知识库erarchical data structure same as XML, means parent, child, sub child... like that one using vb.net. so ho can i create that one?
You can use the XElement
class to model an XML tree.
Here is the general pattern for creating parent-child relationships.
Public Class Node
Private m_Children As List(Of Node) = New List(Of Node)
Public ReadOnly Property Children() As List(Of Node)
Get
Return m_Children
End Get
End Property
End Class
精彩评论