cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vadim.gritse...@verizon.net>
Subject RE: esql & transformations
Date Thu, 04 Apr 2002 12:50:40 GMT
See http://localhost:8080/cocoon/sub/xsl-cocoon sample. It does
generates XSL using XSP.

Vadim

> From: Jerzy Kut [mailto:jerzyk@rzeszow.tiger.com.pl]
> 
> Hi all!
> Can I use esql in transformation file? How?
> I try:
> 
> employees-xsp.xsl
> 
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
>                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                 xmlns:xsp="http://apache.org/xsp"
>                 xmlns:esql="http://apache.org/cocoon/SQL/v2">
> 
>  <xsl:template match="employees">
>  <esql:connection>
>   <esql:pool>epayroll</esql:pool>
>   <esql:execute-query>
>    <esql:query>
>     select E1.EMPNO, E1.ENAME, E1.JOB, E2.EMPNO MGRNO, E2.ENAME MGR,
> E1.HIREDATE, E1.SAL, E1.COMM, D.DEPTNO, D.DNAME
>     from EMP E1, EMP E2, DEPT D
>     where E1.DEPTNO = D.DEPTNO
>     and E1.MGR = E2.EMPNO (+)
>    </esql:query>
>    <esql:results>
>     <esql:row-results>
>      <employee>
>       <id><esql:get-long column="EMPNO"/></id>
>       <name><esql:get-string column="ENAME"/></name>
>       <job><esql:get-string column="JOB"/></job>
>       <hiredate><esql:get-date column="HIREDATE"/></hiredate>
>       <manager-name><esql:get-string column="MGR"/></manager-name>
>       <manager-id><esql:get-long column="MGRNO"/></manager-id>
>       <salary><esql:get-double column="SAL"/></salary>
>       <comm><esql:get-string column="COMM"/></comm>
>       <department-id><esql:get-long column="DEPTNO"/></department-id>
>       <department-name><esql:get-string
column="DNAME"/></department-name>
>      </employee>
>     </esql:row-results>
>    </esql:results>
>    <esql:no-results>
>     <employee-lack>
>      <message>No data!</message>
>     </employee-lack>
>    </esql:no-results>
>   </esql:execute-query>
>  </esql:connection>
>  </xsl:template>
> 
>  <xsl:template match="node()|@*">
>   <xsl:copy>
>    <xsl:apply-templates select="node()|@*"/>
>   </xsl:copy>
>  </xsl:template>
> 
> </xsl:stylesheet>
> 
> sitemap.xmap
> 
>    <map:match pattern="main">
>     <map:aggregate element="main">
>      <map:part src="docs/description.xml"/>
>      <map:part src="docs/manager.xml"/>
>     </map:aggregate>
>     <map:transform src="stylesheets/employees-xsp.xsl"/>
>     <map:serialize type="xml"/>
>    </map:match>
> 
> but unfortunatelly it doesn't work.
> Help please (cocoon2.0.2).
> 
> Best regards
> 
> Jerzy Kut


---------------------------------------------------------------------
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