Dictionary のリストに変換された json オブジェクトがあります。json は次のとおりです。
{
"DataList":
{"Non Fuel":
{
"sn":"/DataXmlProduct/Customers/DataXml/Customer/DueDate",
"ItemCode":"/DataXmlProduct/Customers/DataXml/Customer/InvoiceNo",
"Qty":"/DataXmlProduct/Customers/DataXml/Customer/CustomerNo",
"Amount":"DataXml/Customer/TotalCurrentCharges"
},
"Fuel":{
"sn":"/DataXmlProduct/Customers/DataXml/Customer/InvoiceNo",
"ItemCode":"/DataXmlProduct/Customers/DataXml/Customer/InvoiceNo",
"Amount":"DataXml/Customer/TotalCurrentCharges"
}
}
}
結果は ( Dictionary<string, object>
) です。ここで、各ディクショナリの値は再びディクショナリであり、ディクショナリの各値を動的に反復し、値が Xpath である最後のキーと値を取得する必要があり、xpath から値を取得する必要があります。 . 辞書を反復処理するための解決策を教えてください。json 形式はユーザー入力によって異なる可能性があるため、一般的なものにする必要があります。