Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to read/write to an XML file

Status
Not open for further replies.

cmn2

Programmer
Mar 6, 2003
73
US
I'm definetely new to xml and could use some basic help. My situation is this... I am working in VB.net and have an XML document. I need to write values to the elements within that document. In another .net program I will need to retrieve those values back. What is the best way to do this? I have seen lots of conversation on the DOM and XSL, but am struggling in wrapping my arms around the concepts. Can someone explain how they basically work, what purpose they serve and how would they be applied to the situation I outlined. Any code samples would really be appreciated. Thank you in advance to anyone who can take the time to help out.
 
Think of a XML document as a directory structure. When changing directories, you need to issue statements to make that happen (C:, d:, cd .., cd \winnt, etc). Same when you go to create a directory -- you typically need to navigate to the parent directory then issue a md or mkdir command.

The DOM represents the directory tree, and you use XPath queries to navigate between directories (nodes). Just like in DOS you say DIR t*.* to get all files that start with "t", you can use a XPath to do a similar thing: "\\t*", which returns all nodes named "t" starting at the root.

Take a look at: thread426-532663

Chip H.
 
Great analogies! Thank you both for responding to my question. Day by day the pieces are starting to fall into place. I'm sure I'll have follow up questions. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top