{
"DeviceProfile": {
"-xmlns": "http://www.hp.com/schema/m2m/",
"Metadata": {
"Model": "DEMO",
"OntologyReference": {
"-xmlns:tns": "http://www.YY.com/schema/m2m/",
"-xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
}
},
"AssetParams": [
{
"-ParamName": "Device-ID",
"-DisplayName": "Device-ID",
"-Mandatory": "true",
"-ReadOnly": "true",
"-DataType": "String",
"-Category": "IoT",
"-LiveUpdate": "false",
"-xpath": "'Unit-ID''",
"-Decoding": "none",
"-MinLength": "1"
},
{
"-ParamName": "deviceHost",
"-DisplayName": "Device Host",
"-Mandatory": "false",
"-ReadOnly": "false",
"-DataType": "String",
"-Category": "IoT",
"-Decoding": "none"
}
]
}
}
如何在javascript中仅获取AssetParams作为json对象,如下所示:
{"AssetParams": [
{
"-ParamName": "Device-ID",
"-DisplayName": "Device-ID",
"-Mandatory": "true",
....
]}