The scope of XML and DOM in .NET 3.5 is so large that I'm having trouble coming up with a simple solution to my problem without using too many lines of messy code. Since people here always come up with some elegant solutions, I thought it would be a good question.
How do I take in an XML file (that I created and saved earlier in the program) that has n instances of the 'unit' node beneath the root 'report' node to create an XML DOM that has the 'report' values and one 'unit'.
I need to do this for each unit and then create an HTML file using my existing XSL transformation stylesheet on the new XML DOMs. I can already get it to work for all the units (the existing XML file), but I need a report for each unit.
EDIT (per comment request):
What it looks like:
<report>
<report_name>Name</report_name>
<report_date>yyyy/mm/dd</report_date>
<unit>
<ip>127.0.0.1</ip>
<label>localhost</label>
..etc
</unit>
<unit>
<ip>255.255.255.255</ip>
<label>broadcast</label>
..etc
</unit>
<report>
And I want each of:
<report>
<report_name>Name</report_name>
<report_date>yyyy/mm/dd</report_date>
<unit>
<ip>127.0.0.1</ip>
<label>localhost</label>
..etc
</unit>
</report>
and
<report>
<report_name>Name</report_name>
<report_date>yyyy/mm/dd</report_date>
<unit>
<ip>255.255.255.255</ip>
<label>broadcast</label>
..etc
</unit>
<report>