Hello,

Why do you assume that format (DTD) should be recognized during xml data parsing
only?
For example, You can use different file extensions for different XML according
used DTD or you can use different URI prefixes to distinguish appropriate
Cocoon's pipeline.

Roman

Nicola Ken Barozzi wrote:

> From: "Peter Flynn" <[EMAIL PROTECTED]>
>
> > >  Sometimes you need to use unique XSL file for several XML files,
> > >  but this is also solved by the sitemap in a varios ways, e.g.:
> > >
> > >  <map:match pattern=3D"*.xml">
> > >      <map:generate src=3D"{1}.xml/>
> > >      <map:transform src=3D"{1}.xsl"/>
> > >      <map:serialize />
> > >  </map:match>
> >
> > That 1:1 kind of match is very rare. Much more importantly, there
> > seems to be no provision in sitemap.xmap for binding a stylesheet to a
> > DTD. Let's suppose I have 3,000 DocBook <article> documents in many
> > many directories, but these directories also contain many other .xml
> > files (related to the articles in many different ways) which require
> > different stylesheets, according to their DTD.
> >
> > I want all *.xml files which use DocBook article to be served into
> > HTML using foo.xsl; all *.xml which use (say) TEI-Lite to be served
> > using another stylesheet, etc etc. Can this be done?
>
> I get your point, and you are right: Cocoon should be able to apply
> stylesheets also based on DTD.
>
> Now, this can be done in current Cocoon, only that the needed components
> haven't beed written yet.
> The main reason for this is basically speed and common legacy usage
> patterns.
>
> What you need is an Action that reads the file that creates a parameter with
> inside the DTD URI contained in the source file.
> Then you can use in it Matchers or Selectors to select an appropriate
> stylesheet based on the DTD.
>
> Hope this helps :-)
>
> --
> Nicola Ken Barozzi                   [EMAIL PROTECTED]
>             - verba volant, scripta manent -
>    (discussions get forgotten, just code remains)
> ---------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>


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

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to