json-doc()

node-set json-doc(string path)

converts the JSON document at the given path into OXN, parses it and returns the <json> root element.

Relative paths are resolved relative to the flow file's path.

user.json:

{
  "name": "brenda"
}
json-doc("user.json")/name

Example: Read a JSON config

Flow:

<flow>
  <echo if="json-doc('fit://site/conf.json')/maintenance" status="503">
    Under maintenance
  </echo>
</flow>

Last updated