|
-
Sep 11th, 2002, 12:09 PM
#1
Thread Starter
Hyperactive Member
XML Schema Relations
Hello all.. I have an XML document, created the XML Schema (XSD), then added some Keys and a relation to the schema.. When I open up the XML file, the relation is not there. It seems like its not reading the schema file.. here is my code:
VB Code:
Public Sub LoadFromXML(ByVal strXMLFile As String)
Dim nodElement As New TreeNode() 'Create a Generic Element Node
Dim nodParent As New TreeNode() 'Create a Generic Parent Node
' Create and Open DataSet from XML
Dim dsXMLNames As New DataSet("DotNetSend")
dsXMLNames.ReadXml(strXMLFile)
With dsXMLNames.Tables("Groups")
Dim r As DataRow 'Create Generic DataRow
'Loop through all Rows in Group table
For Each r In .Rows
nodParent = New TreeNode()
nodParent.Text = r("Name").ToString()
'nodParent.Expand()
Dim c As DataRow 'Create Generic DataRow
'Loop through all child rows of parent
For Each c In r.GetChildRows("GroupsUsers")
nodElement = New TreeNode()
'Set Node Properties
With nodElement
.Checked = c("Selected").ToString()
.Tag = c("Name").ToString()
.Text = c("Description").ToString()
End With
'Add Child node to Parent
nodParent.Nodes.Add(nodElement)
nodElement = Nothing
Next c
'Add Parent to Treeview
tvUsers.Nodes.Add(nodParent)
nodParent = Nothing
Next r
End With
End Sub
How am I supposed to link the xml file to the schema? Also, can I put the schema inline inside the .xml file? Lastly, why doesnt this work!?!?!
-mcd
[vbcode]
'*****************************
MsgBox "MCD :: [email protected]", vbInformation + vbOKOnly, "User"
'*****************************
[/vbcode]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|