cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicola Ken Barozzi" <nicola...@apache.org>
Subject Re: Fw: Serving static XML files a la Cocoon-1
Date Sun, 28 Apr 2002 21:46:59 GMT
From: "Peter Flynn" <pflynn@imbolc.ucc.ie>

> >  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                   nicolaken@apache.org
            - 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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message