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

Re: Validation...

From: Imsieke, Gerrit, le-tex <gerrit.imsieke@le-tex.de>
Date: Sat, 19 Nov 2011 23:08:35 +0100
Message-ID: <4EC828E3.7040303@le-tex.de>
To: xproc-dev@w3.org
I had or rather I still have similar issues. I was bothered by the fact 
that Schematron validation provides a "report" port which the 
schema-based validations lack.

p:validate-with-relax-ng for example has a single output port which will 
only reproduce the document if it is valid (or if @assert-valid="false").

In order to catch errors, I wrapped p:validate-with-relax-ng into a 
try/catch and forwarded the "error" port of the catch branch to a 
"report" output port that I declared for both branches.

I just found out that p:validate-with-relax-ng will only give me the 
first error. But it’s wrapped in c:errors and c:error elements, like this:

<c:errors xmlns:c="http://www.w3.org/ns/xproc-step"><c:error line="14" 
column="9">org.xml.sax.SAXParseException: element "hs" not allowed 
anywhere; expected the element end-tag, text or element "a", "abbr",
or "var" (with xmlns:ns="http://www.w3.org/2000/svg")</c:error></c:errors>

cx:nvdl, on the other hand, will only return an error status so that I get
<c:errors xmlns:c="http://www.w3.org/ns/xproc-step"/>
on the report port.
In addition, it will document both errors in my document on STDOUT, like 

C:\cygwin\home\gerrit\…\bcss-testsuite_000264.xhtml:14:9: error: element 
"hs" not allowed anywhere; expected the element end-tag, text
"table", "tt", "ul" or "var" (with xmlns:ns="http://www.w3.org/2000/svg")
C:\cygwin\home\gerrit\…\bcss-testsuite_000264.xhtml:15:27: error: 
element "ps" not allowed anywhere; expected the element end-tag, text
"table", "tt", "ul" or "var" (with xmlns:ns="http://www.w3.org/2000/svg")

A uniform report port for all types of validation is clearly desirable. 
The types of documents that might appear on that port will differ. For 
Schematron, it will typically be an SVRL document. For all kind of 
schema validations, it may be a newly introduced top-level report 
element, for example
<c:validation-report type="relax-ng" status="invalid"> …

For invalid documents and if @assert-valid="false", this report will be 
issued on the report port (which will issue a <c:validation-report 
type="relax-ng" status="valid" /> for valid documents).

Maybe this is an idea for the next XProc iteration. Or did I miss 
something obvious, and there is already unified validation reporting (in 
XML format) for all kinds of validation steps?


On 2011-11-19 21:41, Nic Gibson wrote:
> DTD. Relax NG.
> Not actually needed to do XSD via XProc yet. It may be that I've missed something but I don't see a way to get validation errors as XML.
> nic
> --
> On 18 Nov 2011, at 17:16, Norman Walsh wrote:
>> Nic Gibson<nicg@corbas.net>  writes:
>>> I've been doing a fair bit of XProc that does validation recently and
>>> one thing that I keep stumbling is the output from the various
>>> validation steps. It has one problem - it's text!
>> What kind of validation? I thought the error reports were XML.
>>                                         Be seeing you,
>>                                           norm
>> --
>> Norman Walsh
>> Lead Engineer
>> MarkLogic Corporation
>> Phone: +1 413 624 6676
>> www.marklogic.com
> --
> Corbas Consulting
> Digital Publishing Consultancy and Training
> http://www.corbas.co.uk, +44 (0)7718 906817/+44 (0)1273 930765	

Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit.imsieke@le-tex.de, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler
Received on Saturday, 19 November 2011 22:09:15 UTC

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