私は、構文解析XMLに問題があるが、これは私のxmlです:解析のXML - 空の要素
<Invoice version="6.0.1">
<DocumentType>1</DocumentType>
<ID>FV17116113</ID>
<InvoiceLines>
<InvoiceLine>
<UnitPrice>25</UnitPrice>
</InvoiceLine>
<InvoiceLine>
<UnitPrice>55</UnitPrice>
</InvoiceLine>
</InvoiceLines>
</Invoice>
私はこのコードを試してみてください。
XmlDocument xml= new XmlDocument();
xml.Load(sourcexml);
foreach (XmlElement row in xml.DocumentElement.SelectNodes("InvoiceLines/InvoiceLine"))
{
}
をしかし、私は要素の行には何もありません.... お願いしますか?
あなたのコードが正常に動作する必要があります動作します。 'sourcexml'が何であるか確認できますか? – HHLV
@HHLV - 私は1つのファイルだけを読み込みます。* .isdoc ...この形式ではスタンドアートxml ... – koky
[うまくいくようです](https://dotnetfiddle.net/W6nXWa) - [mcve]( https://stackoverflow.com/help/mcve) – Default