私は従来のASPプロジェクトに取り組んでおり、ASP Xtreme Evolutionを使用してJSonデータを解析しています(ここにあります:http://zend.lojcomm.com.br/entries/classic-asp-json-revisited/)
とにかく...私はほとんどのJSonデータを正しく取得していますが、今は配列で立ち往生しています。
JSonは次のようになります。
{
"Product": {
"ID": "6666",
"Name": "Tha name",
"ArticleGroup": [
{
"@handleas": "array",
"Title": "Title 1",
"Article": {
"ID": "777",
"Label": "Label 1",
}
},
{
"@handleas": "array",
"Title": "Title 2",
"Article": {
"ID": "888",
"Label": "Label 2",
}
}
]
}
}
}
そして、ASPは次のようになります。
set xmlHTTP = server.createobject("MSXML2.ServerXMLHTTP.6.0")
xmlHTTP.open "GET", "http://source.of.json", false
xmlHTTP.send()
ProductFeed = xmlHTTP.ResponseText
dim ProductInfo : set ProductInfo = JSON.parse(join(array(ProductFeed)))
dim key : for each key in ProductInfo.Product.keys()
Response.Write ProductInfo.Product.ID ' Prints 6666
Response.Write ProductInfo.Product.Name ' Prints Tha Name
Next
set ProductInfo = nothing
私の問題は、ArticleGroupの情報にアクセスする方法がわからないことです。私が得るのは[オブジェクトオブジェクト]、[オブジェクトオブジェクト]または空の値だけです。
誰かアイデアはありますか?
ありがとう!