Use the validation outcome in the result

  Hi,

  How can I get the result of the validation of a document with
an XML Schema?  I expected an output port like 'outcome' like:

    <c:validation success="false" href="/uri/of/document.xml">
       <c:error> ... some infos ...</c:error>
       <c:error> ... some infos ...</c:error>
       ...
    </c:validation>

  It seems I cannot have something else than a failure in case the
document is not valid (or just ignoring the validation result, but
neither is interesting in my case).

  If this is true, I would at least know which document is invalid.
So far I have the following to validate a bunch of files:

    <p:for-each>
       <p:iteration-source select="/files/file"/>
       <p:load>
	  <p:with-option name="href" select="."/>
       </p:load>
       <p:validate-with-xml-schema assert-valid="true">
	  <p:input port="schema">
	     <p:document href="my-schema.xsd"/>
	  </p:input>
       </p:validate-with-xml-schema>
    </p:for-each>

  The input document looks like:

    <files>
       <file>/absolute/file/name.xml</file>
       <file>/another/one.xml</file>
       <file>/etc.xml</file>
       ...
    </files>

  If I set assert-valid="false", I cannot display a list of invalid
files because this is not available to subsequent steps, and if I set
assert-valid="true" the pipeline just fails without having the chance
to do anything.

  Did I miss something?

  Regards,

-- 
Florent Georges
http://fgeorges.org/

Received on Friday, 13 August 2010 16:08:50 UTC