Results 1 to 2 of 2

Thread: XML as datasource

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    XML as datasource

    I'm just starting to really get into xml these days. I have written a utility that will email out notifications of an event. I want to have an external list of 'subscribed' users that I can manipulate without having to re-compile everytime someone is added or deleted from the 'list'.

    I figure xml is the easiest way to go. Here is what I have so far but I can't figure out how to read the nodes and create a semi-colon delimited string out of them.
    VB Code:
    1. <?xml version="1.0" encoding="utf-8" ?>
    2. <configuration xmlns="http://tempuri.org/App.xsd">
    3.     <user>[email protected]</user>
    4.     <user>[email protected]</user>
    5.     <user>[email protected]</user>
    6.     <user>[email protected]</user>
    7. </configuration>

    I've looked into the xmlTextReader class and some others but i'm thoroughly confused on the subject. What advice can someone give me here?

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: XML as datasource

    VB Code:
    1. Dim xDoc As New XmlDocument
    2.         xDoc.Load("c:\emails.xml")
    3.         For Each xElement As XmlElement In xDoc.DocumentElement.GetElementsByTagName("user")
    4.             Debug.WriteLine(xElement.InnerText)
    5.         Next

    has Imports System.Xml at the top.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width