The following is the XML I have to work with. Below is the question
<Table0>
<CaseID>10211 4</CaseID>
<CaseNumber>1 </CaseNumber>
<DateOpened>200 5-06-14T07:26:00.000 0000-05:00</DateOpened>
<OnCallPerson />
<CallType>Expos ure</CallType>
<ExposureReason >General</ExposureReason>
<OtherExposureR eason>Unintenti onal</OtherExposureRe ason>
<ClientName>Tes t Client</ClientName>
<Priority>Mediu m</Priority>
<Table1>
<CaseID>10211 4</CaseID>
<CaseProductID> 1</CaseProductID>
<ProductName>Pr oduct B</ProductName>
</Table1>
<Table1>
<CaseID>10211 4</CaseID>
<CaseProductID> 2</CaseProductID>
<ProductName>Pr oduct A</ProductName>
</Table1>
<Table2>
<ProductIssue>N ot applicable</ProductIssue>
<CaseID>10211 4</CaseID>
</Table2>
<Table3>
<CaseID>10211 4</CaseID>
<CaseCallerID>2 3290</CaseCallerID>
<CallerName>Joh n Doe</CallerName>
<Address>123 Main Street</Address>
<City>Brookly n</City>
<State>NY</State>
<ZipCode>1234 5</ZipCode>
<Country>USA</Country>
<Phone>12345678 90</Phone>
<Relation>Sel f</Relation>
</Table3>
<Table4>
<CaseID>10211 4</CaseID>
<CasePatientID> 102114</CasePatientID>
<Gender>Male</Gender>
<ExposureTime />
<ManagementSite >Managed on site</ManagementSite>
<SymptomOnset>3 0 min or less</SymptomOnset>
<SymptomDuratio n>Unknown</SymptomDuration >
<Age>Unknown</Age>
<Severity>Minor </Severity>
<Table5>
<CaseID>10211 4</CaseID>
<CasePatientID> 102114</CasePatientID>
<ExposureRoute> Dermal</ExposureRoute>
</Table5>
<Table6>
<CaseID>10211 4</CaseID>
<CasePatientID> 102114</CasePatientID>
<Symptom>: Irritation/Pain</Symptom>
</Table6>
<Table7>
<CaseID>10211 4</CaseID>
<CasePatientID> 102114</CasePatientID>
<Therapy>wash </Therapy>
</Table7>
<Table7>
<CaseID>10211 4</CaseID>
<CasePatientID> 102114</CasePatientID>
<Therapy>Othe r</Therapy>
</Table7>
</Table4>
<Table8>
<Note>Caller used product this morning</Note>
<CreatedOn>20 05-06-14T07:27:00.000 0000-05:00</CreatedOn>
<CaseID>10211 4</CaseID>
</Table8>
<Table8>
<Note>No Followup number. Close case.</Note>
<CreatedOn>20 01-06-21T12:12:00.000 0000-05:00</CreatedOn>
<CaseID>10211 4</CaseID>
</Table8>
</Table0>
I need to convert all this data to a CSV format. How do I do it using
XSLT. I can do the simple for each loop but when it comes to the
nested Table1, Table2 I get lost how do I reference those nested values
notice that All the Tables 0 to 8 can have 0 to n number of entries
with Table 0 needing at least one.