次のxmlがある場合:
XDocument xDocument = new XDocument(
new XElement("RootElement",
new XElement("ChildElement",
new XAttribute("Attribute1", "Hello"),
new XAttribute("Attribute2", "World")
),
new XElement("ChildElement",
new XAttribute("Attribute1", "Foo"),
new XAttribute("Attribute2", "Bar")
)
)
);
LINQ "を使用して"Hello、Foo"を出力した後です。表記。
使って「こんにちは」がもらえる
xDocument.Element("RootElement").Element("ChildElement").Attribute("Attribute1").Value;
を使用してすべての属性を取得できます
xDocument.Element("RootElement").Elements("ChildElement").Attributes("Attribute1");
属性の文字列値のリストを取得して、コンマ区切りのリストとして結合できるようにするにはどうすればよいですか?