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><map:components/></tt> section:</p>
+++ <p>To configure this transformer do as with any other component: it needs to be
+++ declared in a sitemap's <tt><map:components/></tt> section:</p>
<pre><map:components>
...
<map:transformers default="...">
...
--- <strong> <map:transformer name="validate"
+++ <strong> <map:transformer name="validation-report"
logger="sitemap.transformer.validate"
--- src="org.apache.cocoon.transformation.ValidatingTransformer">
---
+++ src="org.apache.cocoon.transformation.ValidationReportTransformer">
+++
<!--+ 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)
+-->
<!-- <grammar>... grammar identifier ...</grammar> -->
</map:transformer>
--- </strong>
--- ...
+++ </strong> ...
</map:transformers>
</map:components>
</pre>
<p>The only defined (but <strong>not required</strong>) configuration element
for this component is <tt><grammar><em>... grammar identifier
...</em></grammar></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)
<map:match src="...">
<map:generate src="..."/>
...
--- <strong><map:transform type="jing" src="myschema.rng">
+++ <strong><map:transform type="validation-report" src="myschema.rng">
<!-- <map:parameter name="grammar" value="... identifier ..."/> -->
</map:transform>
</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><report xmlns="http://apache.org/cocoon/validation/1.0">
+++ <warning system="..." public="..." line="..." column="...">
+++ ... detailed message ...
+++ </warning>
+++ <error system="..." public="..." line="..." column="...">
+++ ... detailed message ...
+++ </error>
+++ <fatal system="..." public="..." line="..." column="...">
+++ ... message ...
+++ </fatal>
+++ </report>
+++ </pre>
+++
+++ <p>The location attributes specified in the <tt><warning/></tt>,
+++ <tt><error/></tt> and <tt><fatal/></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