parse
The parse
action inspects the main content in fit://request/content
. If it can be parsed into a DOM, the flow continues. Otherwise the request is terminated and the content sent to the client. This way the action guarantees that all subsequent actions find a DOM in fit://request/content
.
This action is part of the default flow.
This action has no options.
Example:
<flow>
<default-request />
<parse />
</flow>
The action is idempotent: If the main content is already parsed, it has no effect.
Before the actual parsing is done, text filters are applied to the content. This is configurable in conf/config.xml
.
The action has two ways to determine how to handle the main content:
m
, which in turn is set by the URL rewriter The request purpose, which is set automatically only for <script>
or <link
rel="stylesheet">
elements, has precedence over the content type. You can use this manually to handle JSON data.
If the meta data is used, the parser is derived from the content type. Most XML and HTML content types are detected automatically. However, you can overwrite the parser with the request option <parser
value="xml|html" />
.
ress/image-scaling
conf/config.xml
.The request will be terminated, if no main content is found. That is, fit://request/content
is empty and no Content-type
header could be obtained via meta data. Usually that means that your flow path is lacking any content generator (as copy
or requests
).