cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: DTD validation: "Unsupported grammar language"
Date Thu, 21 Dec 2006 00:09:49 GMT
Hello Lars,

just from having a look at the code:
1. It's http://www.w3.org/TR/REC-xml (see Validator interface and its 
declared constants).
2. This exception is thrown in AbstractValidator.getValidationHandler() 
in line 327 in the current code. It is thrown when no SchemaParser can 
be found.
3. Grammars and their parsers seem to be configured via 
Configurable.configure(). So maybe the javadoc for this method [1] is 
helpful. Otherwise you might need to have a look into the code of this 
method or do some debugging.

Regards
Jörg

[1] 
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/validation/jaxp/JaxpSchemaParser.html#configure(org.apache.avalon.framework.configuration.Configuration)

On 19.12.2006 18:32, Lars Huttar wrote:
> Hello,
> I seconded this question on the Cocoon user list but have not received a 
> response, so would like to ask the developers.
> In Cocoon 2.1.9, we are trying to use ValidationReportTransformer to 
> validate our XML against a DTD. I'm looking at the documentation at 
> http://cocoon.zones.apache.org/daisy/documentation/864/validation.html 
> and 
> http://cocoon.zones.apache.org/daisy/documentation/components/1058/g2/691.html. 
> 
> The validation sample block has examples for validating against RNG and 
> XML Schema, but not against a DTD.
> Like José quoted below, I'm trying to figure out how to make it work.
> Here's my attempt, a copy-and-modify of a match pattern in 
> samples\blocks\validation\sitemap.xmap:
>      <map:match pattern="report-dtd-valid">
>        <map:generate src="source-ok.xml"/>
>        <map:transform type="validation-report" src="schema-ok.dtd">
>          <map:parameter name="grammar" 
> value="http://www.w3.org/TR/REC-xml" />
>        </map:transform>
>        <map:transform src="context:/stylesheets/system/xml2html.xslt"/>
>        <map:serialize/>
>      </map:match>
> 
> I added the "grammar" parameter, as instructed by the documentation 
> referenced above, to the validation-report transformer.
> For grammar identifier, the documentation seemed to indicate I should 
> use "http://www.w3.org/TR/REC-xml". (I also tried "dtd" just for kicks.)
> But the result is that I get the error
>    org.apache.cocoon.components.validation.ValidatorException: 
> Unsupported grammar languagehttp://www.w3.org/TR/REC-xml
> 
> Does this mean there is no support for validating against DTDs? Or am I 
> doing something wrong?
> 
> Thanks,
> Lars

Mime
View raw message