私は三つのクラスLINQ to XMLクエリの作成に誰か助けてもらえますか?
ExamProduced:
+ ExamID
+ Date
+ Seed
+ Exercises
Exercise
+ Quantity
+ IsMakeUp
+ Score
+ Answers
Answer
+ IsCorrect
を持っていると私は、このXMLファイル
<Answers ExamID="1" StudentID="abcd" Date="10/26/2011 11:50:34 AM"
Seed="495" IsSED="False">
<Summary>
<Objective ID="1" MakeUp="False" Quantify="5"
Difficulty="Easy" Accredited="True" Produced="True">
<Details Result="0" Date="10/26/2011 11:35:18 AM" />
<Details Result="1" Date="10/26/2011 11:50:34 AM" />
</Objective>
<Objective ID="2" MakeUp="True" Quantify="5"
Difficulty="Easy" Accredited="False" Produced="True">
<Details Result="0" Date="10/26/2011 11:35:18 AM" />
<Details Result="0" Date="10/26/2011 11:50:34 AM" />
</Objective>
<Objective ID="3" MakeUp="True" Quantify="2"
Difficulty="Easy" Accredited="False" Produced="False">
<Details Result="0" Date="10/26/2011 11:35:18 AM" />
<Details Result="0" Date="10/26/2011 11:50:34 AM" />
</Objective>
</Summary>
<Answer ProblemID="0" ObjectiveID="1" IsCorrect="True" Difficulty="Easy">
<Result DataType="System.Decimal" Value="9" />
</Answer>
<Answer ProblemID="0" ObjectiveID="1" IsCorrect="True" Difficulty="Easy">
<Result DataType="System.Decimal" Value="20" />
</Answer>
<Answer ProblemID="0" ObjectiveID="1" IsCorrect="True" Difficulty="Easy">
<Result DataType="System.Decimal" Value="16" />
</Answer>
<Answer ProblemID="0" ObjectiveID="1" IsCorrect="True" Difficulty="Easy">
<Result DataType="System.Decimal" Value="36" />
</Answer>
<Answer ProblemID="0" ObjectiveID="1" IsCorrect="True" Difficulty="Easy">
<Result DataType="System.Decimal" Value="18" />
</Answer>
<Answer ProblemID="0" ObjectiveID="2" IsCorrect="False" Difficulty="Easy">
<Result DataType="System.Decimal" Value="Null" />
</Answer>
<Answer ProblemID="0" ObjectiveID="2" IsCorrect="False" Difficulty="Easy">
<Result DataType="System.Decimal" Value="Null" />
</Answer>
<Answer ProblemID="0" ObjectiveID="2" IsCorrect="False" Difficulty="Easy">
<Result DataType="System.Decimal" Value="Null" />
</Answer>
<Answer ProblemID="0" ObjectiveID="2" IsCorrect="False" Difficulty="Easy">
<Result DataType="System.Decimal" Value="Null" />
</Answer>
<Answer ProblemID="0" ObjectiveID="2" IsCorrect="False" Difficulty="Easy">
<Result DataType="System.Decimal" Value="Null" />
</Answer>
</Answers>
を持っているまあ、私はこのクエリを作成するには、ヘルプのビットを必要としています。 ExamProducedプロパティはルートを通過できます。次に、演習では、タグサマリーを見てください、ここでは歴史的な..ですので、私はその属性のProducedが真である値を取得する必要があります。
例えば、生成される2つの目的は、1つの目的と2つの目的のアイデアです。次に、私は値の量を取得し、(運動クラスのために)メイクアップする必要があります。そして、1と2の目的が作成されたように、値が正しくないと間違っていれば、それぞれの回答が得られます。
ありがとうございます。
EDIT
: は、このケースでは例えば、クラスが持っている必要があります。ExamProduced
+ ExamID: 1
+ Date: 10/26/2011 11:50:34 AM
+ Seed: 495
+ Exercises: { 2 items }
{
Exercise
{
+ Quantity = 5
+ IsMakeUp = False;
+ Score = 1 (it means one hundred for Answers/Summary/Objective/LastDetail => Result)
+ Answers (5 items)
{
Answer
{
+ IsCorrect = true
}
Answer
{
+ Is...
}
Ans {..}
Ans {..}
Ans {..}
}
}
Exercise
{
...
}
}
ジェフは、[編集]をご確認ください.. – Darf
更新されました。 –