我需要删除实体的属性,但我得到错误“找不到上下文元素”。我已经应用了教程的xml示例(Tutorial)。
我要删除的属性是'timestamp'。我已经检查过这个退出了。这里我显示输出:
<?xml version="1.0"?>
<queryContextResponse>
<contextResponseList>
<contextElementResponse>
<contextElement>
<entityId type="Sensor" isPattern="false">
<id>1</id>
</entityId>
<contextAttributeList>
<contextAttribute>
<name>timestamp</name>
<type>string</type>
<contextValue>2015-04-15 11:10:00</contextValue>
</contextAttribute>
</contextAttributeList>
</contextElement>
<statusCode>
<code>200</code>
<reasonPhrase>OK</reasonPhrase>
</statusCode>
</contextElementResponse>
这里是删除它的xml代码:
(curl localhost:1026/NGSI10/updateContext -s -S --header 'Content-Type: application/xml' -d @- | xmllint --format - ) <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<updateContextRequest>
<contextElementList>
<contextElement>
<entityId type="Sensor" isPattern="false">
<id>1</id>
</entityId>
<contextAttributeList>
<contextAttribute>
<name>timestamp</name>
<type>string</type>
<contextValue/>
</contextAttribute>
</contextAttributeList>
</contextElement>
</contextElementList>
<updateAction>DELETE</updateAction>
</updateContextRequest>
EOF
你能帮帮我吗?