Yesterday he comes to me with a request to convert a VBA function I wrote to format data from an Access database, into a C# class that formats that data, now in an xml file, the same way. So I know everything that needs to be done, but have absolutely no idea how to go about it!
I've got big points for anybody who's willing to hold my hand and walk me thru this!
Scenario (see attached 80018210.xml):
The xml data describes a daily report from a rail-flaw detection vehicle, using induction and ultrasonics to test railroad tracks for defects (cracks, wear, internal flaws).
The Reports collection contains the service data for the day. There is one Report node for each customer serviced in a day.
Within a Report node, there is one Location node per customer location or within a location with a non-contiguous milepost.
Within a Location node, there is a Movement node for every action performed on the track(or road) in that location, as well as a Defect node, if any defects were marked.
In the Movement node, an MCODE of 0 represents the beginning of a test, an MCODE of 7 represents the movement half of a defect record, and an MCODE of 5 marks the end of a test.
The example report describes the 'worst case' scenario for the purposes of the output I need: there are 4 Location nodes (LOCID), but only 2 distinct customer locations (LNNUM), 7100 and 7101, with the added twist that 7101 exists between different segments of 7100.
Each customer location, by LNNUM, is output to a separate file.
Each file begins with a Header line, containing: LNNUM, Total miles tested, number of tested segments, CAR number, number of Defects found, Date, Operator, Total test time, total Delay time, etc.
The next lines describe the tested segments: the TrackID, and the mileposts at the beginning and end of the test.
If any defects were found within the milepost range of a tested segment, that defect must be listed under the segment in which it was found. Defect info includes milepost, trackside (L/R), defect type, defect size, defect number, etc.
an array of unique LNNUMs in the Report
a way to combine the Movement nodes of multiple Location nodes into a single dataset or hashtable, so total time and miles for the specific LNNUM can be calculated.
a technique to capture the mileposts of the 0-5 pairs that comprise a test segment.
a way to insert the defects directly below the correct test segment in the set of test segments.
If anyone would like to take a shot at this with me, please let me know soonest...my bossman knows I'm on a learning curve - he's given me to Tuesday next to come up with something. Thank goodness for the 4th of July, or he'd want it Monday!
In the meantime, it's back to search-and-skim, looking for answers to questions I'm not sure how to ask!