W3C home > Mailing lists > Public > xproc-dev@w3.org > November 2008

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

From: Costello, Roger L. <costello@mitre.org>
Date: Sat, 22 Nov 2008 11:41:22 -0500
To: "'xproc-dev@w3.org'" <xproc-dev@w3.org>, "Costello, Roger L." <costello@mitre.org>
Message-ID: <9E51F88D5247B648908850C35A3BBB50283A7A47@IMCMBX3.MITRE.ORG>

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"
        <p:input port="source">
            <p:document href="BookStore.xml"/>
        <p:output port="result" />
            <p:validate-with-xml-schema assert-valid="true" mode="strict" name="myValidate">
                <p:input port="schema">
                    <p:document href="BookStore.xsd"/>
                <p:input port="source">
                    <p:pipe step="myValidate" port="result"/>
                <p:input port="source">
Received on Saturday, 22 November 2008 16:41:56 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:04 UTC