473,378 Members | 1,037 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Help Reading A XML File In VB.NET

4
So I am trying to figure out a new part now but I am getting stuck once again and yes I have been reading up on things and I think I know what my problem is I am just not sure how to fix it. Below is the XML I am trying to read. I need to be able to have the user type in a user they are looking for which is assigned to the Role_Search_Value_1.Text box. Then when it finds that user, I want to capture the permissions for that user. So far I have not had any luck in capturing the permission. I think it's because I am not getting down to the permission area and I am not sure why.

XML file
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" ?>
  2. <docuvault_settings>
  3.     <role_list>
  4.         <role obj_name="Logistics" >
  5.             <role_type>master_role</role_type>
  6.             <members>
  7.                 <user domain_name="GFSPROD" account_name="aclippert" permission="000F" />
  8.                 <user domain_name="GFSPROD" account_name="afarner" permission="000F" />
  9.                 <user domain_name="GFSPROD" account_name="akincaid" permission="000F" />
  10.                 <user domain_name="GFSPROD" account_name="akruitho" permission="000F" />
  11.                 <user domain_name="GFSPROD" account_name="arossow" permission="000F" />
  12.                 <user domain_name="GFSPROD" account_name="awhitmor" permission="000F" />
  13.                 <user domain_name="GFSPROD" account_name="bdillet" permission="000F" />
  14.                 <user domain_name="GFSPROD" account_name="bjohnso4" permission="000F" />
  15.                 <user domain_name="GFSPROD" account_name="bkaczano" permission="000F" />
  16.                 <user domain_name="GFSPROD" account_name="blackmer" permission="000F" />
  17.                 <user domain_name="GFSPROD" account_name="bporritt" permission="000F" />
  18.                 <user domain_name="GFSPROD" account_name="bschneider" permission="000F" />
  19.                 <user domain_name="GFSPROD" account_name="btuinst2" permission="000F" />
  20.                 <user domain_name="GFSPROD" account_name="cainsworth" permission="000F" />
  21.                 <user domain_name="GFSPROD" account_name="cjenks" permission="000F" />
  22.                 <user domain_name="GFSPROD" account_name="cpierson" permission="000F" />
  23.                 <user domain_name="GFSPROD" account_name="crosinsk" permission="000F" />
  24.                 <user domain_name="GFSPROD" account_name="cseay" permission="000F" />
  25.                 <user domain_name="GFSPROD" account_name="cwoodcraft" permission="000F" />
  26.                 <user domain_name="GFSPROD" account_name="dclark" permission="000F" />
  27.                 <user domain_name="GFSPROD" account_name="dhozak" permission="000F" />
  28.                 <user domain_name="GFSPROD" account_name="ehoebeke" permission="000F" />
  29.                 <user domain_name="GFSPROD" account_name="ejasinsk" permission="000F" />
  30.                 <user domain_name="GFSPROD" account_name="emathieu" permission="000F" />
  31.                 <user domain_name="GFSPROD" account_name="evanhofw" permission="000F" />
  32.                 <user domain_name="GFSPROD" account_name="ewright" permission="000F" />
  33.                 <user domain_name="GFSPROD" account_name="jashley" permission="000F" />
  34.                 <user domain_name="GFSPROD" account_name="jblevins" permission="000F" />
  35.                 <user domain_name="GFSPROD" account_name="jborst" permission="000F" />
  36.                 <user domain_name="GFSPROD" account_name="jfallot" permission="000F" />
  37.                 <user domain_name="GFSPROD" account_name="jfanco" permission="000F" />
  38.                 <user domain_name="GFSPROD" account_name="jfisher" permission="000F" />
  39.                 <user domain_name="GFSPROD" account_name="jmcinty2" permission="000F" />
  40.                 <user domain_name="GFSPROD" account_name="jostrand" permission="000F" />
  41.                 <user domain_name="GFSPROD" account_name="jsalmon" permission="000F" />
  42.                 <user domain_name="GFSPROD" account_name="jtroutman" permission="000F" />
  43.                 <user domain_name="GFSPROD" account_name="jwierenga" permission="000F" />
  44.                 <user domain_name="GFSPROD" account_name="jwyns" permission="000F" />
  45.                 <user domain_name="GFSPROD" account_name="kduval" permission="000F" />
  46.                 <user domain_name="GFSPROD" account_name="kkrzyzan" permission="000F" />
  47.                 <user domain_name="GFSPROD" account_name="krilett" permission="000F" />
  48.                 <user domain_name="GFSPROD" account_name="ktolliver" permission="000F" />
  49.                 <user domain_name="GFSPROD" account_name="lbadersn" permission="000F" />
  50.                 <user domain_name="GFSPROD" account_name="ldow" permission="000F" />
  51.                 <user domain_name="GFSPROD" account_name="lminasol" permission="000F" />
  52.                 <user domain_name="GFSPROD" account_name="mbattagl" permission="000F" />
  53.                 <user domain_name="GFSPROD" account_name="mbury" permission="000F" />
  54.                 <user domain_name="GFSPROD" account_name="mjenks" permission="000F" />
  55.                 <user domain_name="GFSPROD" account_name="mponstei" permission="000F" />
  56.                 <user domain_name="GFSPROD" account_name="mroberts" permission="000F" />
  57.                 <user domain_name="GFSPROD" account_name="mskowron" permission="000F" />
  58.                 <user domain_name="GFSPROD" account_name="pdodge" permission="000F" />
  59.                 <user domain_name="GFSPROD" account_name="rblue" permission="000F" />
  60.                 <user domain_name="GFSPROD" account_name="rborst" permission="000F" />
  61.                 <user domain_name="GFSPROD" account_name="rcurtis" permission="000F" />
  62.                 <user domain_name="GFSPROD" account_name="rdemann" permission="000F" />
  63.                 <user domain_name="GFSPROD" account_name="rkusmier" permission="000F" />
  64.                 <user domain_name="GFSPROD" account_name="rpearson" permission="000F" />
  65.                 <user domain_name="GFSPROD" account_name="rschuur" permission="000F" />
  66.                 <user domain_name="GFSPROD" account_name="rvanoverloop" permission="000F" />
  67.                 <user domain_name="GFSPROD" account_name="sbeld" permission="000F" />
  68.                 <user domain_name="GFSPROD" account_name="scarlstr" permission="000F" />
  69.                 <user domain_name="GFSPROD" account_name="scooper" permission="000F" />
  70.                 <user domain_name="GFSPROD" account_name="selgersm" permission="000F" />
  71.                 <user domain_name="GFSPROD" account_name="shicks" permission="000F" />
  72.                 <user domain_name="GFSPROD" account_name="spycraft" permission="000F" />
  73.                 <user domain_name="GFSPROD" account_name="ssperling" permission="000F" />
  74.                 <user domain_name="GFSPROD" account_name="steveadams" permission="000F" />
  75.                 <user domain_name="GFSPROD" account_name="swright4" permission="000F" />
  76.                 <user domain_name="GFSPROD" account_name="tdrier" permission="000F" />
  77.                 <user domain_name="GFSPROD" account_name="tfoxcole" permission="000F" />
  78.                 <user domain_name="GFSPROD" account_name="theemstra" permission="000F" />
  79.                 <user domain_name="GFSPROD" account_name="tkwiatko" permission="000F" />
  80.                 <user domain_name="GFSPROD" account_name="tmartell" permission="000F" />
  81.                 <user domain_name="GFSPROD" account_name="tneifert" permission="000F" />
  82.                 <user domain_name="GFSPROD" account_name="twoody" permission="000F" />
  83.             </members>
  84.  
So for example if I wanted to search for the user 'akincaid' that would be assigned to the Role_Search_Value_1.text box and should return the Logistics and 000F.

Here is my code right now....

Expand|Select|Wrap|Line Numbers
  1. m_xmld = New XmlDocument()
  2.         m_xmld.Load("C:\Share\GR_Prd_DV1_roles.xml")
  3.         m_nodelist = m_xmld.SelectNodes("docuvault_settings/role_list/role")
  4.         For Each m_node In m_nodelist
  5.  
  6.             Dim aliceNode As XmlNode = m_node.SelectSingleNode("members/user[@account_name='" & Role_Search_Value_1.Text & "']")
  7.  
  8.             If aliceNode IsNot Nothing Then
  9.                 Name = m_node.Attributes.GetNamedItem("obj_name").Value
  10.                 Permission = m_node.Attributes.GetNamedItem("permission").Value
  11.  
Am I right or way off? I mean is that why I am getting a 'NullReferenceException was unhandled" for....

Expand|Select|Wrap|Line Numbers
  1. Permission = m_node.Attributes.GetNamedItem("permission").Value
  2.  
I am trying really hard to grasp this XML reading. It can be a bit tricky I am learning.

Thanks in advance.
Aug 13 '08 #1
3 1548
vb2008
4
Any help please? I am really stuck here. :-(
Aug 14 '08 #2
joedeene
583 512MB
you might have better results/help posting in the proper forum, based on your title this question should be in the .NET forum. so i'd recommend reading the site's rules http://bytes.com/forum/faq.php?faq=posting_guidelines and in the meantime im gonna ask a moderator to redirect/move the forum... but i'm sorry i really can't help you, im not experienced in that area, by the way what language are you using ?
Aug 14 '08 #3
vb2008
4
Oh sorry. It's VB.NET.

Thanks!
Aug 14 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: nephish | last post by:
Hey there, i am trying to write an online application using the cgi module. what i want to do is have an html form display a drop-down list and have the values of that list be the lines of text...
1
by: Hafeez | last post by:
I am having real trouble compiling this code http://www.cs.wisc.edu/~vganti/birchcode/codeHier/AttrProj.tgz The attachment shows errors when compiled using the current version of g++ in a...
2
by: Parker.Jim | last post by:
I need to write a program which performs word subsitutions on a text file. The program should input the names of three text files: the source file that will be "edited", a text file that contains...
3
by: Chi | last post by:
what is the "unable to write data to the transport connection" I use the oreilly , programming c# using System; using System.Net.Sockets; using System.Text; using System.IO; // get a file...
36
by: felixnielsen | last post by:
What i really wanna do, is defining my own types, it doesnt really matter why. Anyway, i have run into some problems 1) typedef unsigned short U16; U16 test = 0xffffffff; // There should be a...
66
by: genestarwing | last post by:
QUESTION: Write a program that opens and read a text file and records how many times each word occurs in the file. Use a binary search tree modified to store both a word and the number of times it...
2
by: -D- | last post by:
I'm taking my first stab at using xml, so please bear with my novice questions and understanding of xml. I'm trying to create an xml file that holds all my website navigation. If I understand...
1
by: syhzaidi | last post by:
How can we do Parsing of Hexdecimel in C# reading string from stream file for eg.. i have a file like.......... 0f 2f 12 2d 3a.......in hexa decimal save in a file.txt and i m reading it from...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
22
by: Amali | last post by:
I'm newdie in c programming. this is my first project in programming. I have to write a program for a airline reservation. this is what i have done yet. but when it runs it shows the number of...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.