content() #

nodeset content([string request-id])

The content() function is a convenient function to access upstream response bodies from inside the flow.

<flow>
  <if test="content()/html/head/title = 'Thank you'">
    …
  </if>
</flow>

When called without parameters, the function returns the main content DOM from fit://request/content.

The following test expressions are equivalent:

Be aware that fit://request/content and fit://request/content/main are not the same thing! While the first starts as a copy of the latter, flow actions may alter fit://request/content throughout the request. fit://request/content/main holds the plain text response body and usually remains unchanged. Thus, content() and content('main') are not necessarily equivalent.

Optionally, a request ID can be passed to read data from fit://request/content/<ID>:

The content function returns a node-set that contains the document node of the DOM in fit://request/content/<ID>. If the content does not exist, the node-set will be empty.