質問編集履歴
1
C#のコードを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -23,3 +23,65 @@
|
|
23
23
|
一応Messageまでは取れるのですが、内部のSuccessやFailにアクセスする方法が判りません。
|
24
24
|
|
25
25
|
よろしくお願いいたします
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
```C#
|
30
|
+
|
31
|
+
using System;
|
32
|
+
|
33
|
+
using System.Collections.Generic;
|
34
|
+
|
35
|
+
using System.Linq;
|
36
|
+
|
37
|
+
using System.Text;
|
38
|
+
|
39
|
+
using System.Threading.Tasks;
|
40
|
+
|
41
|
+
using System.Linq;
|
42
|
+
|
43
|
+
using System.Xml.Linq;
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
namespace ConsoleApp1
|
48
|
+
|
49
|
+
{
|
50
|
+
|
51
|
+
class Program
|
52
|
+
|
53
|
+
{
|
54
|
+
|
55
|
+
static void Main(string[] args)
|
56
|
+
|
57
|
+
{
|
58
|
+
|
59
|
+
XElement xml = XElement.Load(@"Test.xml");
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
//Messageのタグ内の情報を取得する
|
64
|
+
|
65
|
+
IEnumerable<XElement> infos = from item in xml.Elements("Message") select item; // ここまではとれている(currentがnull)
|
66
|
+
|
67
|
+
// ここから下の(infoの)出力がない
|
68
|
+
|
69
|
+
foreach (XElement info in infos)
|
70
|
+
|
71
|
+
{
|
72
|
+
|
73
|
+
Console.Write(info.Element("Success").Value + @",");
|
74
|
+
|
75
|
+
Console.Write(info.Element("Fail").Value + @",");
|
76
|
+
|
77
|
+
}
|
78
|
+
|
79
|
+
Console.ReadKey();
|
80
|
+
|
81
|
+
}
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
}
|
86
|
+
|
87
|
+
```
|