cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars Huttar <lars_hut...@sil.org>
Subject Re: trouble with ValidationReportTransformer
Date Tue, 25 May 2010 20:55:15 GMT
On 5/25/2010 2:07 PM, Lars Huttar wrote:
> ...
> Maybe I can work around the problem by specifying the grammar
> explicitly, instead of relying on the component to guess the grammar
> (RNG). However, none of the samples in the Cocoon sample block show
> how to do this. The Cocoon top-level sitemap shows an example of
> grammar config but without telling what values to use for grammar
> identifiers. What value do I use to say "rng"?
>
> For documentation, the Cocoon sample block says to go to
> http://cocoon.zones.apache.org/daisy/documentation/691.html
> but that gives an error!
> I found some javadoc at
> http://www.java2s.com/Open-Source/Java-Document/Web-Framework/cocoon/org/apache/cocoon/transformation/ValidationReportTransformer.java.java-doc.htm
> which helps. But I don't see where to find the allowed values for the
> grammar parameter.
>
> Thanks for any help with how to get validation instead of the
> exception, or what to use for the grammar parameter.
>
> Lars
>

Success!
Following some hints from the documentation (after browsing several
classes), I tried using the URL from the "grammar detected" exception as
the grammar id, "http://relaxng.org/ns/structure/1.0":
                <map:transform type="validation-report"
src="cocoon://mount/gemination/{1}.rng" label="raw-report">
                    <map:parameter name="grammar"
value="http://relaxng.org/ns/structure/1.0" />
                </map:transform>

It worked!

Oh, then I googled on that and found all the valid values for the
grammar parameter, at
http://cocoon.apache.org/2.1/apidocs/constant-values.html#org.apache.cocoon.components.validation.Validator.GRAMMAR_RELAX_NG

Nice that Schematron is in the list. I wonder if it's possible to use
RNC format? (the compact form of RNG)

Lars


Mime
View raw message