Click to See Complete Forum and Search --> : XmlDoc Writer Helper


patrickcbrown
June 7th, 2006, 03:23 PM
Hello

Does anyone know of any Design Patterns or helper classes that have been written to simplify the task of programatically creating and updating XmlDocuments?

It is easy enough to use XmlDocument and other related classes to do this, the problem is that you end up writing and rewriting many functions with very specific knowledge on how to iterate through the document to find the location to do your inserts etc. I am rather new to writing the documents though so there may well be a better way.

Thanks for your time and ideas
Patrick

Igor Soukhov
June 7th, 2006, 08:20 PM
A lot of the people end up with the their own helper classes with the following set of methods:


CreateAttribute(XmlEmenent, attributeName);
CreateElement(elementName);
GetElement(xpath);
GetAttribute(xpath)
GetElementValue(xpath);
GetAttributeValue(xpath)


With the functions above you can do most of the simple creating/updating.

Non-trivial updating-tranformations usually implemented using XSLT.


Hello

Does anyone know of any Design Patterns or helper classes that have been written to simplify the task of programatically creating and updating XmlDocuments?

It is easy enough to use XmlDocument and other related classes to do this, the problem is that you end up writing and rewriting many functions with very specific knowledge on how to iterate through the document to find the location to do your inserts etc. I am rather new to writing the documents though so there may well be a better way.

Thanks for your time and ideas
Patrick