W3C home > Mailing lists > Public > xproc-dev@w3.org > August 2010

Use the validation outcome in the result

From: Florent Georges <fgeorges@fgeorges.org>
Date: Fri, 13 Aug 2010 17:07:55 +0100
Message-ID: <AANLkTinEUu38vT3Q49V1SxL3i36KoH5Fx82M=vhsWQtQ@mail.gmail.com>
To: XProc Dev <xproc-dev@w3.org>
  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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 13 August 2010 16:08:50 GMT