From: Jean-Paul R. <re...@gm...> - 2020-11-25 07:26:03
|
Dear Alisdair, is there a reason not to use eXist's triggers? https://exist-db.org/exist/apps/doc/triggers ie. store the exterior source in a specific collection -> triggers XSLT transformation and stores new result (it seems to me any templates you are using can be rewritten into the transformation Xquery itself and avoid going through view at all)? This might allow finer control of each step, particularly when things go sideways? Best, JPR On Wed, Nov 25, 2020 at 7:28 AM Alasdair Dougall <ala...@gm...> wrote: > Hi All, > > My wife's recipe website has recipes that are mainly static with some > dynamic sections. > > In effect, I can crawl the site to get the pages, but I would rather > trigger a xquery on saving a document within given directories to generate > html files and to store them in the appropriate directory. So, is it > possible to run a query that would produce similar output to: > > <dispatch xmlns="http://exist.sourceforge.net/NS/exist"> > <forward url="{$exist:controller}/xquery/{$pagetype}.xql"> > <set-attribute name="indexkey" value="{$exist:resource}"/> > <set-attribute name="xslt.input" value="model"/> > <set-attribute name="xslt.stylesheet" > value="{concat($exist:root,$exist:controller,"/templates/",$pagetype,".xslt")}"/> > <set-attribute name="title" > value="{request:get-attribute('title')}"/> > <set-attribute name="keywords" > value="{request:get-attribute('keywords')}"/> > </forward> > <view> > <forward servlet="XSLTServlet"> > <set-attribute name="xslt.uri" value="{request:get-uri()}"/> > <clear-attribute name="xslt.input"/> > </forward> > <forward url="{$exist:controller}/modules/view.xql"/> > </view> > <error-handler> > ..... > </error-handler> > </dispatch> > > So the sequence of calls are: > > 1. Call pagetype.xql as in recipe.xql > 2. Transform withXSLTServlet using a forward to pagetype.xslt, i.e. > recipe.xslt > 3. Call view to expand templating entities > > Thanks in advance, > > Alasdair > > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > |