次のように定義された列を持つXMLとしてExcelスプレッドシート出力があります。
<Row ss:AutoFitHeight="0">
<Cell ss:StyleID="ColumnHead">
<ss:Data ss:Type="String">#</ss:Data>
</Cell>
<Cell ss:StyleID="ColumnHead">
<ss:Data ss:Type="String">prefix</ss:Data>
</Cell>
<Cell ss:StyleID="ColumnHead">
<ss:Data ss:Type="String">name</ss:Data>
</Cell>
<Cell ss:StyleID="ColumnHead">
<ss:Data ss:Type="String">label</ss:Data>
</Cell>
<Cell ss:StyleID="ColumnHead">
<ss:Data ss:Type="String">totalLabel</ss:Data>
</Cell>
<Cell ss:StyleID="ColumnHead">
<ss:Data ss:Type="String">base schema</ss:Data>
</Cell>
<Cell ss:StyleID="ColumnHead">
<ss:Data ss:Type="String">systemid</ss:Data>
</Cell>
<Cell ss:StyleID="ColumnHead">
<ss:Data ss:Type="String">prohibit</ss:Data>
</Cell>
</Row>
そしてここに1つの例の行があります:
<Row ss:AutoFitHeight="0">
<Cell ss:StyleID="NoBorderNumberCell">
<ss:Data ss:Type="Number">1</ss:Data>
</Cell>
<Cell ss:StyleID="NoBorderCell">
<ss:Data ss:Type="String">ifrs</ss:Data>
</Cell>
<Cell ss:StyleID="NoBorderCell">
<ss:Data ss:Type="String">AccountingProfit</ss:Data>
</Cell>
<Cell ss:StyleID="NoBorderCell">
<ss:Data ss:Type="String">Accounting profit</ss:Data>
</Cell>
<Cell ss:StyleID="NoBorderCell"/>
<Cell ss:StyleID="NoBorderCell">
<ss:Data ss:Type="String">full_entry_point</ss:Data>
</Cell>
</Row>
問題は、どのセルにどの列がないかをどのように検出するかです。毎回各列を各値にペアリングできるようにするには、ソースにすべての空のセルに対して空白の自己終了タグが必要ですか?
C#でこの状況をどのように管理しますか?私には最低限の権利がありますが、欠落している列を説明するためにそれを分離する方法がわかりません。
if (reader.Name == "ss:Data")
{
while (reader.Read())
Response.Write(reader.Value);
}