J
jleslie48
Hello,
so I"m given an xml file of an excel spreadsheet that has 3 worksheets
in it on line three I open the element "Workbook" and then:
***********************************************************
<?xml version="1.0"?>
<?mso-application progID="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-comffice:spreadsheet"
xmlns="urn:schemas-microsoft-comfficeffice"
xmlns:x="urn:schemas-microsoft-comffice:excel"
xmlns:ss="urn:schemas-microsoft-comffice:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-comfficeffice">
<LastAuthor>Ron Thorson</LastAuthor>
<LastPrinted>2010-03-15T17:43:03Z</LastPrinted>
<Created>2010-03-15T11:45:27Z</Created>
<LastSaved>2010-03-15T13:39:16Z</LastSaved>
<Version>1.0</Version>
</DocumentProperties>
<OfficeDocumentSettings xmlns="urn:schemas-microsoft-
comfficeffice">
<DownloadComponents/>
<LocationOfComponents HRef="file:///E:\"/>
</OfficeDocumentSettings>
<ExcelWorkbook xmlns="urn:schemas-microsoft-comffice:excel">
<WindowHeight>5280</WindowHeight>
<WindowWidth>9000</WindowWidth>
.... a whole lot of stuff and then ....
</Styles>
<Worksheet ss:Name="Messages">
<Table ss:StyleID="s22" ssefaultColumnWidth="42"
ssefaultRowHeight="11.25">
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="150"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="150"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="200"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="280"/>
.... a whole punch of stuff for the worksheet (messages)...
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
<Worksheet ss:Name="UL-0">
<Table ss:StyleID="s22" ssefaultColumnWidth="42"
ssefaultRowHeight="11.25">
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
..... now a bunch of stuff for worksheet (UL-0)...
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
<Worksheet ss:Name="DL-0">
<Table ss:StyleID="s22" ssefaultColumnWidth="42"
ssefaultRowHeight="11.25">
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="200"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="150"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="100"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Row ss:StyleID="s33" ss:AutoFitHeight="0" ss:Height="14.25">
<Cell ss:StyleID="s33"><Data ss:Type="String">Date</Data></Cell>
<Cell ss:StyleID="s33"><Data ss:Type="String">Time</Data></Cell>
<Cell ss:StyleID="s33"><Data ss:Type="String">Type</Data></Cell>
<Cell ss:StyleID="s33"><Data ss:Type="String">Sub Type</Data></Cell>
<Cell ss:StyleID="s33"><Data ss:Type="String">Transaction</Data></
Cell>
.... now I'm looking at the data for worksheet "DL-0" this is the one I
want...
<Cell ss:StyleID="s85"><Data ss:Type="Number">0</Data></Cell>
<Cell ss:StyleID="s108"><Data ss:Type="Number">0.0</Data></Cell>
<Cell ss:StyleID="s32"><Data ss:Type="String">High</Data></Cell>
<Cell ss:StyleID="s32"><Data ss:Type="String">Primary</Data></Cell>
<Cell ss:StyleID="s85"><Data ss:Type="Number">6</Data></Cell>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-comffice:excel">
<PageSetup>
<Layout x:Orientation="Landscape" x:CenterHorizontal="1"/>
<Header x:Margin="0.19"/>
<Footer xata="&R&D &T"/>
<PageMargins x:Left="0.24" x:Right="0.16" x:Top="0.38"/>
</PageSetup>
<Selected/>
<DoNotDisplayGridlines/>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
</Workbook>
************************************************************
that is the end of the file.
I want to process the data in the worksheet "DL-0" only. I want to
make an answer set of the rows of data of that worksheet pulling out
specific columns, say the Date column (that is the first one) and the
time (the second column) and specific ones of the 3-12 (although I'd
be happy with a 2D array of all the rows and columns. )
Can someone show me and explain the naming sequence for either
GetElementsByTagName, or
foreach (XmlElement xxx in doc.SelectNodes(???) or
some other methodology?
I see there is something with the AT sign (@) that I think makes a
selected answer set, sorry, I'm new at this.
so I"m given an xml file of an excel spreadsheet that has 3 worksheets
in it on line three I open the element "Workbook" and then:
***********************************************************
<?xml version="1.0"?>
<?mso-application progID="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-comffice:spreadsheet"
xmlns="urn:schemas-microsoft-comfficeffice"
xmlns:x="urn:schemas-microsoft-comffice:excel"
xmlns:ss="urn:schemas-microsoft-comffice:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-comfficeffice">
<LastAuthor>Ron Thorson</LastAuthor>
<LastPrinted>2010-03-15T17:43:03Z</LastPrinted>
<Created>2010-03-15T11:45:27Z</Created>
<LastSaved>2010-03-15T13:39:16Z</LastSaved>
<Version>1.0</Version>
</DocumentProperties>
<OfficeDocumentSettings xmlns="urn:schemas-microsoft-
comfficeffice">
<DownloadComponents/>
<LocationOfComponents HRef="file:///E:\"/>
</OfficeDocumentSettings>
<ExcelWorkbook xmlns="urn:schemas-microsoft-comffice:excel">
<WindowHeight>5280</WindowHeight>
<WindowWidth>9000</WindowWidth>
.... a whole lot of stuff and then ....
</Styles>
<Worksheet ss:Name="Messages">
<Table ss:StyleID="s22" ssefaultColumnWidth="42"
ssefaultRowHeight="11.25">
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="150"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="150"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="200"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="280"/>
.... a whole punch of stuff for the worksheet (messages)...
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
<Worksheet ss:Name="UL-0">
<Table ss:StyleID="s22" ssefaultColumnWidth="42"
ssefaultRowHeight="11.25">
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
..... now a bunch of stuff for worksheet (UL-0)...
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
<Worksheet ss:Name="DL-0">
<Table ss:StyleID="s22" ssefaultColumnWidth="42"
ssefaultRowHeight="11.25">
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="200"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="150"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="100"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="65"/>
<Row ss:StyleID="s33" ss:AutoFitHeight="0" ss:Height="14.25">
<Cell ss:StyleID="s33"><Data ss:Type="String">Date</Data></Cell>
<Cell ss:StyleID="s33"><Data ss:Type="String">Time</Data></Cell>
<Cell ss:StyleID="s33"><Data ss:Type="String">Type</Data></Cell>
<Cell ss:StyleID="s33"><Data ss:Type="String">Sub Type</Data></Cell>
<Cell ss:StyleID="s33"><Data ss:Type="String">Transaction</Data></
Cell>
.... now I'm looking at the data for worksheet "DL-0" this is the one I
want...
<Cell ss:StyleID="s85"><Data ss:Type="Number">0</Data></Cell>
<Cell ss:StyleID="s108"><Data ss:Type="Number">0.0</Data></Cell>
<Cell ss:StyleID="s32"><Data ss:Type="String">High</Data></Cell>
<Cell ss:StyleID="s32"><Data ss:Type="String">Primary</Data></Cell>
<Cell ss:StyleID="s85"><Data ss:Type="Number">6</Data></Cell>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-comffice:excel">
<PageSetup>
<Layout x:Orientation="Landscape" x:CenterHorizontal="1"/>
<Header x:Margin="0.19"/>
<Footer xata="&R&D &T"/>
<PageMargins x:Left="0.24" x:Right="0.16" x:Top="0.38"/>
</PageSetup>
<Selected/>
<DoNotDisplayGridlines/>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
</Workbook>
************************************************************
that is the end of the file.
I want to process the data in the worksheet "DL-0" only. I want to
make an answer set of the rows of data of that worksheet pulling out
specific columns, say the Date column (that is the first one) and the
time (the second column) and specific ones of the 3-12 (although I'd
be happy with a 2D array of all the rows and columns. )
Can someone show me and explain the naming sequence for either
GetElementsByTagName, or
foreach (XmlElement xxx in doc.SelectNodes(???) or
some other methodology?
I see there is something with the AT sign (@) that I think makes a
selected answer set, sorry, I'm new at this.