On Sep 10, 2008, at 4:21, Carlos Tejo Alonso wrote:
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 [EMAIL PROTECTED]
...
</> </>
XSLT to convert result set into whatever format you need.
HTH,
A.
[1] http://cocoon.apache.org/2.1/userdocs/sql-transformer.html
[2] http://cocoon.apache.org/2.2/blocks/databases/1.0/926_1_1.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]