jsonClose
Version 23.4.8841
jsonClose
Version 23.4.8841
Close the readable JSON handle created by jsonOpen.
必要なパラメータ
- handle: A readable handle reference to the JSON data.
例
Here is an example that uses jsonOpen to create a handle for some static JSON text and then pass that handle to another operation (in this case, the second operation is jsonDOMGet). It then uses jsonClose to close the handle created by jsonOpen.
<!-- 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>
Note: Make sure to use a jsonClose operation anytime you use jsonOpen to avoid leaking memory through open handles.