私は次のXML持っている場合: "" 私は、出力の "Hello、Fooの" LINQを使用した後だXDocument/LINQのCONCATENATE属性値
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")
)
)
);
を表記
私は
xDocument.Element("RootElement").Element("ChildElement").Attribute("Attribute1").Value;
を使用して「こんにちは」を得ることができます私は私ができるように、私は、属性の文字列値のリストを取得できますか
xDocument.Element("RootElement").Elements("ChildElement").Attributes("Attribute1");
を使用してすべての属性を取得することができますコンマで区切ったリストに参加しますか?
私はそれを行う必要がありました。 Linqクエリを使用するのではなく、表記法。あなたが完全に正しい方向に私を指摘したように、Butr、+1。 –
ああ、申し訳ありませんが、私は通常、慣習から外れたクエリ構文を使用します。 – womp