Skip to content

Instantly share code, notes, and snippets.

Created March 13, 2012 00:49
What would you like to do?
Using the exception catcher processor in XPL, with Orbeon Forms
<?xml version="1.0" encoding="utf-8"?>
<p:config xmlns:p=""
<p:param name="instance" type="input"/>
<p:param name="data" type="output"/>
<!-- Using the URL generator, which here will 404 -->
<p:processor name="oxf:url-generator">
<p:input name="config">
<p:output name="data" id="url-data"/>
<!-- The exception catcher behaves like the identity processor if there is no exception -->
<!-- However if there is an exception, it catches it, and you get a serialized form of the exception -->
<p:processor name="oxf:exception-catcher">
<p:input name="data" href="#url-data"/>
<p:output name="data" id="url-data-checked"/>
<!-- Check whether we had an exception -->
<p:choose href="#url-data-checked">
<p:when test="/exceptions">
<!-- Extract the message -->
<p:processor name="oxf:xslt">
<p:input name="data" href="#url-data-checked"/>
<p:input name="config">
<message xsl:version="2.0">
<xsl:value-of select="/exceptions/exception/message"/>
<p:output name="data" ref="data"/>
<!-- Just return the document -->
<p:processor name="oxf:identity">
<p:input name="data" href="#url-data-checked"/>
<p:output name="data" ref="data"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment