You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by da...@cocoon.zones.apache.org on 2005/09/14 00:28:42 UTC

[DAISY] Updated: ValidationReportTransformer

A document has been updated:

http://cocoon.zones.apache.org/daisy/documentation/691.html

Document ID: 691
Branch: main
Language: default
Name: ValidationReportTransformer (unchanged)
Document Type: Document (unchanged)
Updated on: 9/13/05 10:28:22 PM
Updated by: Pier Fumagalli

A new version has been created, state: publish

Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 3924 bytes (previous version: 3436 bytes)
Content diff:
    <html>
    <body>
    
--- <p>The <tt>ValidatingTransformer</tt> provides a very simple
--- <tt>Transformer</tt> implementation validating documents in a pipeline using the
--- validation framework provided by the validation block.</p>
+++ <p>The <tt>ValidationReportTransformer</tt> is a <tt>Transformer</tt> preparing
+++ reports about the validation of a document in Cocoon pipeline using the
+++ validation framework provided by the <a href="daisy:683">validation block</a>.
+++ </p>
    
--- <p>The configuration for this transformer is extremely easy: Like any other
--- component, it needs to be declared in a sitemap's
--- <tt>&lt;map:components/&gt;</tt> section:</p>
+++ <p>To configure this transformer do as with any other component: it needs to be
+++ declared in a sitemap's <tt>&lt;map:components/&gt;</tt> section:</p>
    
    <pre>&lt;map:components&gt;
      ...
      &lt;map:transformers default="..."&gt;
        ...
--- <strong>    &lt;map:transformer name="validate"
+++ <strong>    &lt;map:transformer name="validation-report"
          logger="sitemap.transformer.validate"
---       src="org.apache.cocoon.transformation.ValidatingTransformer"&gt;
---    
+++       src="org.apache.cocoon.transformation.ValidationReportTransformer"&gt;
+++ 
          &lt;!--+ The "grammar" an optional configuration element specifying the default
                | grammar used by the validator. When the "grammar" element is specified,
                | the automatic detection of schema types will be disabled.
(6 equal lines skipped)
                +--&gt;
          &lt;!-- &lt;grammar&gt;... grammar identifier ...&lt;/grammar&gt; --&gt;
        &lt;/map:transformer&gt;
--- </strong>
---     ...
+++ </strong>    ...
      &lt;/map:transformers&gt;
    &lt;/map:components&gt;
    </pre>
    
    <p>The only defined (but <strong>not required</strong>) configuration element
    for this component is <tt>&lt;grammar&gt;<em>... grammar identifier
    ...</em>&lt;/grammar&gt;</tt> indicating the grammar to pass to the Validator
--- component. See the documentation of the validation block for more information on
--- what this means.</p>
+++ component. See the documentation of the <a href="daisy:683">validation block</a>
+++ for more information on what this means.</p>
    
    <p>The use of the <tt>ValidatingTransformer</tt> is again extremely simple.
    Simply declare it in the pipeline like any other transformer:</p>
(4 equal lines skipped)
      &lt;map:match src="..."&gt;
        &lt;map:generate src="..."/&gt;
        ...
---     <strong>&lt;map:transform type="jing" src="myschema.rng"&gt;
+++     <strong>&lt;map:transform type="validation-report" src="myschema.rng"&gt;
          &lt;!-- &lt;map:parameter name="grammar" value="... identifier ..."/&gt; --&gt;
        &lt;/map:transform&gt;
       </strong> ...
(18 equal lines skipped)
    it for a specific pipeline with the XML DTD grammar identifier (which can't be
    detected, as it's not an XML document).</p>
    
--- <p>Note that if multiple errors occur in any document, only the first one will
--- be reported: this transformer doesn't give you a report of all errors in the
--- document, it simply fail on the first error detected. Another transformer, the
--- <tt>ValidationReportTransformer</tt> allows to produce validation reports.</p>
+++ <p>After the validation is completed, the <tt>ValidationReportTransformer</tt>
+++ will emit a report somehow similar to this one:</p>
    
+++ <pre>&lt;report xmlns="http://apache.org/cocoon/validation/1.0"&gt;
+++   &lt;warning system="..." public="..." line="..." column="..."&gt;
+++     ... detailed message ...
+++   &lt;/warning&gt;
+++   &lt;error system="..." public="..." line="..." column="..."&gt;
+++     ... detailed message ...
+++   &lt;/error&gt;
+++   &lt;fatal system="..." public="..." line="..." column="..."&gt;
+++     ... message ...
+++   &lt;/fatal&gt;
+++ &lt;/report&gt;
+++ </pre>
+++ 
+++ <p>The location attributes specified in the <tt>&lt;warning/&gt;</tt>,
+++ <tt>&lt;error/&gt;</tt> and <tt>&lt;fatal/&gt;</tt> tags are all optional and
+++ will be generated only if known.</p>
+++ 
    </body>
    </html>


Fields
======
no changes

Links
=====
no changes

Custom Fields
=============
no changes

Collections
===========
no changes