必需的參數
- handle: 對 JSON 資料的可讀控制代碼引用。
範例
以下範例使用 jsonOpen 為某些靜態 JSON 文字建立控制代碼,然後將該控制代碼傳遞給另一個運算器(在本例中,第二個運算器是 jsonDOMGet)。 然後它使用 jsonClose 關閉 jsonOpen 建立的控制代碼。請確保在使用 jsonOpen 時使用 jsonClose 運算器,以避免透過開啟控制代碼洩漏記憶體。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
關閉由 jsonOpen 建立的 JSON 控制代碼,以釋放開啟的資源。
<!-- Setting some static JSON text -->
<arc:set attr="json.text" value='{"hello": "world","settings": {"foo": "bar"}}' />
<arc:call op="jsonOpen" in="json" out="output" >
<!-- Setting the json handle as an attribute on a new item that is passed into a second operation -->
<arc:set attr="json2.handle" value="[output.handle]" />
<arc:set attr="json2.map:value1" value="/json/settings/foo" />
<arc:call op="jsonDOMGet" in="json2" out="output2" >
<!-- Here is where you can execute additional script for the operation that is using the handle -->
</arc:call>
<!-- Using the arc:finally keyword to execute the closing of the handle last -->
<arc:finally>
<!-- Calling jsonClose to close the handle created by jsonOpen -->
<arc:call op="jsonClose" in="json2" />
</arc:finally>
</arc:call>