Advertisement

08.15.2008 at 05:54AM PDT, ID: 23651076
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.5

Help Reading A XML File In VB.NET

Asked by vb2009 in .NET, Microsoft Visual Basic.Net, .Net Editors & IDEs

Tags: ,

I am trying to figure out how I would go about getting all the names under the security node when a user name is found under one of the role nodes.  So when I do a search for a name and it finds that name under a role node it should then takes all the names under the members node and show me them.

Any ideas?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
XML Sample....
- <docuvault_settings>
- <role_list>
- <role obj_name="Super Role" role_id="101">
  <role_type>super_role</role_type> 
- <members>
  <user domain_name="GFSPROD" account_name="bringel" permission="807F" /> 
  <user domain_name="GFSPROD" account_name="cdreyer" permission="807F" /> 
  <user domain_name="GFSPROD" account_name="dvansolkema" permission="807F" /> 
  <user domain_name="GFSPROD" account_name="lroberts" permission="807F" /> 
  <user domain_name="GFSPROD" account_name="rdettwiler" permission="807F" /> 
  <user domain_name="GFSPROD" account_name="sboot" permission="807F" /> 
  <user domain_name="GFSPROD" account_name="sprins" permission="807F" /> 
  <user domain_name="GFSPROD" account_name="nhamilto" permission="007F" /> 
  <user domain_name="GFSPROD" account_name="rdevinne" permission="007F" /> 
  <user domain_name="GFSPROD" account_name="tbolman" permission="007F" /> 
  </members>
- <security>
  <user domain_name="GFSPROD" account_name="bringel" permission="800F" /> 
  <user domain_name="GFSPROD" account_name="cdreyer" permission="800F" /> 
  <user domain_name="GFSPROD" account_name="sprins" permission="800F" /> 
  </security>
  </role>
- <role obj_name="Export Role" role_id="201">
  <role_type>admin_role</role_type> 
- <members>
  <user domain_name="GFSPROD" account_name="bringel" permission="807F" /> 
  <user domain_name="GFSPROD" account_name="cdreyer" permission="807F" /> 
  <user domain_name="GFSPROD" account_name="dvansolkema" permission="807F" /> 
  <user domain_name="GFSPROD" account_name="lroberts" permission="807F" /> 
  <user domain_name="GFSPROD" account_name="sboot" permission="807F" /> 
  </members>
- <security>
  <user domain_name="NT AUTHORITY" account_name="SYSTEM" permission="800F" /> 
  </security>
  </role>
 </role_list>
  </docuvault_settings>
 
 
And then here is my code now....
 Dim m_xmld As XmlDocument
        Dim m_nodelist As XmlNodeList
        Dim m_node As XmlNode
        Dim Name As String
        Dim Permission As String
        Dim Domain As String
        Dim Security As String
 
        m_xmld = New XmlDocument()
        m_xmld.Load("C:\Share\GR_Prd_DV1_roles.xml")
        m_nodelist = m_xmld.SelectNodes("docuvault_settings/role_list/role")
 
        For Each m_node In m_nodelist
 
            Dim RoleNode As XmlNode = m_node.SelectSingleNode("members/user[@account_name='" & Role_Search_Value_1.Text & "']")
 
            If RoleNode IsNot Nothing Then
 
                Name = m_node.Attributes.GetNamedItem("obj_name").Value
                Permission = RoleNode.Attributes.GetNamedItem("permission").InnerText
                Domain = RoleNode.Attributes.GetNamedItem("domain_name").InnerText
 
                Security = m_node.SelectSingleNode("security/user").Attributes.GetNamedItem("account_name").InnerText
 
                Report_Screen.Rows.Add(New String() {Name, Role_Search_Value_1.Text, Permission, Domain, Security})
 
                ' Set Grid
                Role_Report_Grid.DataSource = Report_Screen
                Role_Report_Grid.Columns("Role Name").Width = 350
                Role_Report_Grid.Columns("Match Criteria").Width = 300
                Role_Report_Grid.Columns("Permission").Width = 100
                Role_Report_Grid.Columns("Domain").Width = 100
                Role_Report_Grid.Columns("Security").Width = 100
 
            Else
                ' Do nothing
            End If
        Next
 
The area of my code where I have been trying to figure out how to loop through the security node is here...
 Security = m_node.SelectSingleNode("security/user").Attributes.GetNamedItem("account_name").InnerText
[+][-]08.15.2008 at 07:58AM PDT, ID: 22238730

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET, Microsoft Visual Basic.Net, .Net Editors & IDEs
Tags: VB.NET, N/A
Sign Up Now!
Solution Provided By: margajet24
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.15.2008 at 08:10AM PDT, ID: 22238859

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628