cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Tejo Alonso" <carlos.t...@fundacionctic.org>
Subject RE: XSLT, databases and cocoon 2.2
Date Fri, 19 Sep 2008 07:17:38 GMT
Thanks for your answer.

> > I have a .xml document with an <gap id="1"> element. I want 
> to apply a
> > transformer (maybe and xslt) that convert this element into  
> > <xi:include
> > href="http://www.example.org">, where "http://www.example.org" is
> > obtained from a database "test", table "gap2xinclude", 
> using the "id"
> > attribute of the "gap" element.
> 
> I have not used it myself but I think you could use the SQL  
> transformer[1] which is part of the databases block[2].
> 
> XML:
>    <gap id="1"/>
> XSLT to add the database call:
>    <xsl:template match="gap>
>    <sql:execute-query>
>    ...
>    where id={@id}
>    ...
>    </> </>
> XSLT to convert result set into whatever format you need.

Just FYI, it works fine, but I have to added 2 transformations in the
sitemap (and in this order):

<map:transform src="gap2xinclude.xslt" type="xslt"/>
<map:transform src="gap2xinclude.xslt" type="sql">


Regards,

Carlos Tejo Alonso
R&D and Innovation Department
CTIC Foundation [Asturias, Spain]
www.fundacionctic.org 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message