Unable to get a failed schema validation to output "invalid"

Hi Folks,

I am trying to write a pipeline that validates an XML document against an XML Schema. It validation succeeds, output the XML document. If validation fails, output the string "invalid".

Below is the pipeline I wrote. It seems to work as I want when the XML document is valid (i.e. it outputs the XML document). But when the XML document is not valid, it does not behave as I want. Instead of outputting the string "invalid" it generates an error message. 

What am I doing wrong please?  /Roger

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:c="http://www.w3.org/ns/xproc-step">
        <p:input port="source">
            <p:document href="BookStore.xml"/>
        </p:input>
        <p:output port="result" />
    
    <p:try>
        <p:group>
            <p:validate-with-xml-schema assert-valid="true" mode="strict" name="myValidate">
                <p:input port="schema">
                    <p:document href="BookStore.xsd"/>
                </p:input>
            </p:validate-with-xml-schema>
            <p:identity>
                <p:input port="source">
                    <p:pipe step="myValidate" port="result"/>
                    </p:input>
            </p:identity>
        </p:group>
        <p:catch>
            <p:identity>
                <p:input port="source">
                    <p:inline><c:result>invalid</c:result></p:inline>
                    </p:input>
            </p:identity>
        </p:catch>
    </p:try>
    
</p:declare-step>

Received on Saturday, 22 November 2008 16:41:56 UTC