Can the XmlNodeChangedEventHandler delegate be used to reflect changes made to one XML document into

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Friends, Romans and Countrymen!
I have an XML document (Library.xml) like the following:
<Library><br/>
<Mathematics><br/>
<Analysis><br/>
<Book Title="Complex Analysis" Author="Ahlfors" /><br/>
<Book Title="Complex Analysis" Author="Lang <br/>
</Analysis><br/>
</Mathematics><br/>
</Library>
I have another XML document (Invoice.xml) in which the <Book /> nodes have to exactly match the <Book /> nodes in Library.xml, as follows:
<Invoice><br/>
<Book Title="Complex Analysis" Author="Ahlfors" /><br/>
<Book Title="Complex Analysis" Author="Lang" /><br/>
</Invoice>
Now suppose I add an additional <Book /> node to Library.xml, I would like that to automatically reflect in Invoice.xml
<Library><br/>
<Mathematics><br/>
<Analysis><br/>
<Book Title="Complex Analysis" Author="Ahlfors" /><br/>
<Book Title="Complex Analysis" Author="Lang <br/>
<Book Title="Functions of One Complex Variable Vol I" Author="Conway" /><br/>
</Analysis><br/>
</Mathematics><br/>
</Library>
The node <Book Title="Functions of One Complex Variable Vol I" Author="Conway" /> has been freshly inserted. To make that reflect in Invoice.xml, I am planning on using the XmlNodeChangedEventHandler delegate to point to NodeInserted event of the Library.xml
document. Can I put that in the OnStart method of a windows service to automatically poll for changes to Library.xml? If anyone has done this sort of thing before, please let me know how best to go about it.
Any help with the above would be greatly appreciated.
Brutus

View the full article
 
Back
Top