Editing an XML document in C#

Narmarr

New Member
I'm new to C#. I am attempting to edit a spreadsheetXML 2003 document by adding a bunch of nodes to the different worksheets in it. Here is an example of the structure:\[code\]<Workbook> <Worksheet ss:Name="Contact"> <Table> <Column /> <Row /> </Table> </Worksheet> <Worksheet ss:Name="Facility"> <Table> <Column /> <Row /> </Table> </Worksheet></Workbook>\[/code\]What I need to do is to load this XML and insert new nodes at certain places. I'm pretty sure I know how to create new XElement with the nodes under it that I need (there's plenty of tutorials online for that). What I'm having trouble finding is how to find a node and add nodes under it. This is as far as I've got:\[code\]XElement xmlDoc = XElement.Load(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Autodesk\\Revit\\Addins\\2013\\COBiev2.4Template.xml");\[/code\]So, how do I find the "Facility" worksheet and add a new row under the table node in it?
 
Back
Top