You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by David Crossley <cr...@indexgeo.com.au> on 2002/08/15 10:01:40 UTC

Relax NG validation for Cocoon

Ian Atkin wrote:
>>David Crossley wrote:
>>
>>Please do not give up, Ian. Cocoon can certainly do validation
>>as an XML framework now using DTDs. Perhaps later using other
>>schema (Relax NG anyone?).
>
> i'm currently investigating relaxng:-
> - jing seems the validator to use, any probs?

See the Apache Forrest mail archives: there have been a few
threads in the past about using Relax NG and there is one
thread happening there now.
http://marc.theaimsgroup.com/?l=forrest-dev&m=102887074620179

I recall two reports to Forrest of experiments with Jing
(around 6 months ago).

One thing that i am not clear about, is where such validation
capability should be. Is it in Cocoon or Forrest? I suspect
in Cocoon.

We need to be able to validate sources and aggregations at
various points of the pipeline. How does that fit with
Cocoon architecture - a new component?

> - also relaxng has no way for docs to identify schema, any ideas?

In my experiments, Jing is told on the command-line which
*.rng to use against a particular doc.xml, i.e. the declaration
is external to the xml instance.

--David






---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Relax NG validation for Cocoon

Posted by Vadim Gritsenko <va...@verizon.net>.
Ian Atkin wrote:

> it was forrest that woke me up to relaxng, but i'm up to a number of 
> things atm - this wasn't top of the list...
>
> i'm completely lost where cocoon ends and forrest starts, i'd like to 
> see validation first and worry about project boundaries second imho
>
> as for cocoon components (brainstorm):-


:)


> - does validation ocur at the parser level or the sitemap level or both?


Parser only. BTW, current 2.0.4-dev can show '/' page ("welcome") with 
treeprocessor and validation mode turned on. The main issue is XSLT 
stylesheets: writing DTDs for them is PITA.


> a quick win could be:-
> - use the XNIConfigurableFileGenerator from forrest
> - add Andy Clark's JingConfiguration and Jing ( 
> http://www.apache.org/~andyc/neko/doc/index.html )
> - configure in sitemap:-
>
>  <map:match pattern="[pattern]">
>    <map:generate src="[filename]" type="xni">
>       <map:parameter name="config-class" 
> value="org.cyberneko.relaxng.JingConfiguration" />
>       <map:parameter name="grammar" value="[grammar-filename]" />
>    </map:generate>
>       ....
>  </map:match>
>
> would require some hacking, but i think this generator needs a 
> clean-up anyway 


I don't like this idea.


> but then again, this would only work at start of pipeline...
>
> a win all round could be:-
>
> "validator" components, with variants of "doctype|schema|relaxng" 
> (would xpath be handy as well?)


This makes more sence, and may be used in more scenarios.

Vadim


> - definitions passed in through sitemap could override those in files 
> (spec says these are only hints)
> - errors cause redirection to error page or logging or whatever is 
> configured
> - i could see XNI being the saviour here, we could provide 
> doctype/schema from xerces and relax from neko + jing, also allows 
> anyone else to define their own validation components if they need them
> - issues are reliance on xerces and pre-sitemap validation (perhaps 
> multiple parser configs in cocoon.xconf? but how does code choose 
> which to use?)
> - don't know enough technicalities about mid-pipeline components
>
> what do you think?
>
> ian
>
.....




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Relax NG validation for Cocoon

Posted by Ian Atkin <ia...@blueyonder.co.uk>.
it was forrest that woke me up to relaxng, but i'm up to a number of 
things atm - this wasn't top of the list...

i'm completely lost where cocoon ends and forrest starts, i'd like to 
see validation first and worry about project boundaries second imho

as for cocoon components (brainstorm):-
- does validation ocur at the parser level or the sitemap level or both?

a quick win could be:-
- use the XNIConfigurableFileGenerator from forrest
- add Andy Clark's JingConfiguration and Jing ( 
http://www.apache.org/~andyc/neko/doc/index.html )
- configure in sitemap:-

  <map:match pattern="[pattern]">
    <map:generate src="[filename]" type="xni">
       <map:parameter name="config-class" 
value="org.cyberneko.relaxng.JingConfiguration" />
       <map:parameter name="grammar" value="[grammar-filename]" />
    </map:generate>
       ....
  </map:match>

would require some hacking, but i think this generator needs a clean-up 
anyway

but then again, this would only work at start of pipeline...

a win all round could be:-

"validator" components, with variants of "doctype|schema|relaxng" (would 
xpath be handy as well?)
- definitions passed in through sitemap could override those in files 
(spec says these are only hints)
- errors cause redirection to error page or logging or whatever is 
configured
- i could see XNI being the saviour here, we could provide 
doctype/schema from xerces and relax from neko + jing, also allows 
anyone else to define their own validation components if they need them
- issues are reliance on xerces and pre-sitemap validation (perhaps 
multiple parser configs in cocoon.xconf? but how does code choose which 
to use?)
- don't know enough technicalities about mid-pipeline components

what do you think?

ian

David Crossley wrote:

>Ian Atkin wrote:
>  
>
>>>David Crossley wrote:
>>>
>>>Please do not give up, Ian. Cocoon can certainly do validation
>>>as an XML framework now using DTDs. Perhaps later using other
>>>schema (Relax NG anyone?).
>>>      
>>>
>>i'm currently investigating relaxng:-
>>- jing seems the validator to use, any probs?
>>    
>>
>
>See the Apache Forrest mail archives: there have been a few
>threads in the past about using Relax NG and there is one
>thread happening there now.
>http://marc.theaimsgroup.com/?l=forrest-dev&m=102887074620179
>
>I recall two reports to Forrest of experiments with Jing
>(around 6 months ago).
>
>One thing that i am not clear about, is where such validation
>capability should be. Is it in Cocoon or Forrest? I suspect
>in Cocoon.
>
>We need to be able to validate sources and aggregations at
>various points of the pipeline. How does that fit with
>Cocoon architecture - a new component?
>
>  
>
>>- also relaxng has no way for docs to identify schema, any ideas?
>>    
>>
>
>In my experiments, Jing is told on the command-line which
>*.rng to use against a particular doc.xml, i.e. the declaration
>is external to the xml instance.
>
>--David
>
>
>
>
>
>
>---------------------------------------------------------------------
>Please check that your question  has not already been answered in the
>FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
>To unsubscribe, e-mail:     <co...@xml.apache.org>
>For additional commands, e-mail:   <co...@xml.apache.org>
>
>
>  
>



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Relax NG validation for Cocoon

Posted by Leigh Dodds <ld...@ingenta.com>.
> > - also relaxng has no way for docs to identify schema, any ideas?
> 
> In my experiments, Jing is told on the command-line which
> *.rng to use against a particular doc.xml, i.e. the declaration
> is external to the xml instance.

Thats by design. James Clark purposefully decided that identifying how 
a schema gets associated with an instance document is outside the 
scope of RELAX NG. So its up to the implementation.

This actually makes a lot of sense, because if you think it through 
there are many different ways in which one might want to associate 
a schema with a particular document.

Cheers,

L.


-- 
Leigh Dodds
Weblog: http://weblogs.userland.com/eclectic
Home: http://www.ldodds.com
Current Project: http://outerthought.net/wiki/Wiki.jsp
"Pluralitas non est ponenda sine necessitate" -- William of Ockham

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>