I have an xml file that has multiple levels of child nodes. I've successfully read the data to multiple datatables in a dataset but each of the datatables seems to be independent. I want to parse out certain bits of information and consolidate it into one datatable that looks like the following:
XML CODE
DESIRED DATATABLE
XML CODE
HTML:
<Batch>
<BatchInstanceIdentifier>BI53</BatchInstanceIdentifier>
<BatchClassIdentifier>BC3</BatchClassIdentifier>
<BatchClassName>TesseractMailRoom</BatchClassName>
<BatchClassDescription>Training</BatchClassDescription>
<BatchClassVersion>1.0.0.79</BatchClassVersion>
<BatchName>ephesoft1362277230826</BatchName>
<BatchPriority>1</BatchPriority>
<BatchStatus>ReadyForValidation</BatchStatus>
<BatchLocalPath>C:\Ephesoft\SharedFolders\ephesoft-system-folder</BatchLocalPath>
<DocumentClassificationTypes>
<DocumentClassificationType>SearchClassification</DocumentClassificationType>
</DocumentClassificationTypes>
<Documents>
<Document>
<Identifier>DOC1</Identifier>
<Type>Mail</Type>
<Confidence>10.31</Confidence>
<ConfidenceThreshold>20.0</ConfidenceThreshold>
<Valid>true</Valid>
<Reviewed>true</Reviewed>
<ErrorMessage/>
<DocumentLevelFields>
<DocumentLevelField>
<Name>Company</Name>
<Value>Von Maur</Value>
<Type>STRING</Type>
<Confidence>0.0</Confidence>
<FieldOrderNumber>1</FieldOrderNumber>
<FieldValueOptionList/>
</DocumentLevelField>
<DocumentLevelField>
<Name>Date</Name>
<Value>8/13/11</Value>
<Type>DATE</Type>
<Confidence>0.0</Confidence>
<FieldOrderNumber>2</FieldOrderNumber>
<FieldValueOptionList/>
</DocumentLevelField>
<DocumentLevelField>
<Name>Type</Name>
<Value>Invoice</Value>
<Type>STRING</Type>
<Confidence>0.0</Confidence>
<FieldOrderNumber>3</FieldOrderNumber>
<FieldValueOptionList>Invoice;Statement;Other</FieldValueOptionList>
</DocumentLevelField>
<DocumentLevelField>
<Name>Note</Name>
<Value/>
<Type>STRING</Type>
<Confidence>0.0</Confidence>
<FieldOrderNumber>4</FieldOrderNumber>
<FieldValueOptionList/>
</DocumentLevelField>
</DocumentLevelFields>
<Pages>
<Page>
<Identifier>PG0</Identifier>
<OldFileName>HA08_013-0000.tif</OldFileName>
<NewFileName>BI53_0.tif</NewFileName>
<PageLevelFields>
<PageLevelField>
<Name>Image_Compare_Classification</Name>
<Value>Mail_First_Page</Value>
<Confidence>0.0</Confidence>
<FieldOrderNumber>0</FieldOrderNumber>
<AlternateValues>
<AlternateValue>
<Name>Image_Compare_Classification</Name>
<Value>Mail_First_Page</Value>
<Confidence>0.0</Confidence>
<FieldOrderNumber>0</FieldOrderNumber>
</AlternateValue>
<AlternateValue>
<Name>Image_Compare_Classification</Name>
<Value>Mail_Last_Page</Value>
<Confidence>0.0</Confidence>
<FieldOrderNumber>0</FieldOrderNumber>
</AlternateValue>
<AlternateValue>
<Name>Image_Compare_Classification</Name>
<Value>Mail_Middle_Page</Value>
<Confidence>0.0</Confidence>
<FieldOrderNumber>0</FieldOrderNumber>
</AlternateValue>
</AlternateValues>
</PageLevelField>
<PageLevelField>
<Name>Search_Engine_Classification</Name>
<Value>Mail_First_Page</Value>
<Type/>
<Confidence>19.82</Confidence>
<FieldOrderNumber>0</FieldOrderNumber>
<AlternateValues>
<AlternateValue>
<Name>Search_Engine_Classification</Name>
<Value>Mail_First_Page</Value>
<Type/>
<Confidence>19.82</Confidence>
<FieldOrderNumber>0</FieldOrderNumber>
</AlternateValue>
<AlternateValue>
<Name>Search_Engine_Classification</Name>
<Value>Mail_Last_Page</Value>
<Type/>
<Confidence>5.184</Confidence>
<FieldOrderNumber>0</FieldOrderNumber>
</AlternateValue>
<AlternateValue>
<Name>Search_Engine_Classification</Name>
<Value>Mail_Middle_Page</Value>
<Type/>
<Confidence>4.959</Confidence>
<FieldOrderNumber>0</FieldOrderNumber>
</AlternateValue>
</AlternateValues>
</PageLevelField>
</PageLevelFields>
<HocrFileName>BI53_PG0.html</HocrFileName>
<ThumbnailFileName>BI53_PG0_displayThumb.png</ThumbnailFileName>
<ComparisonThumbnailFileName>BI53_PG0_compareThumb.tif</ComparisonThumbnailFileName>
<DisplayFileName>BI53_PG0.png</DisplayFileName>
<OCRInputFileName>BI53_PG0.png</OCRInputFileName>
<Direction>NORTH</Direction>
<IsRotated>false</IsRotated>
</Page>
<Page>...</Page>
</Pages>
<MultiPagePdfFile>BI53_documentDOC1.pdf</MultiPagePdfFile>
</Document>
DESIRED DATATABLE
BatchInstanceIdentifier | Identifier | DocumentLevelField | DocumentLevelField | DocumentLevelField | MultiPagePdfFile | |
BI53 | DOC1 | Von Maur | 8/13/11 | Invoice | BI53_documentDOC1.pdf | |
DOC2 | Blue Cross | 7/15/11 | Statement | BI53_documentDOC2.pdf |