I am looking to develop an application that will either watch a folder for incoming XML documents, or that will run periodically and parse each document that is currently in the inbound folder. I would then like to extract the element values through the xpath, and then insert them into a temporary database. I am having trouble starting because I do not know how to develop this so that it watches a folder or so that it runs through a list of XML documents in a folder. Any help to get me started would be greatly appreciated.
-note: running the application as a scheduled task seems the simplest at this point, but I do not know how to have my application parse XML document 1, and then move onto document 2, etc.
Loading
Jan MontanoPosted Oct 4, 2007, 9:33 PM
You could also consider running your application as a service. This way, as soon as there's an incoming file, you could quickly process it.
For monitoring a directory for incoming files, you could use File.IO.FileSystemWatcher
public partial class Form1 : Form
{
}
the method watcher_Created will be called whenever there's a new xml file in watched directory. From here, you could do the xml parsing.
For parsing xml files, you could find many resources in the internet. Here's one -> XML Parsing in C#. Start with parsing a simple xml file first so you'll get the idea.
AnthonyPosted Oct 4, 2007, 4:36 PM