You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Olivier Billard <ob...@rennes.jouve.fr> on 2003/07/17 15:52:21 UTC

Using built-in stylesheets tags in other built-in stylesheets

Hi all !

I would like to know if there is any issue in using tablibs from built-in stylesheets 
(like esql) in user-custom built-in stylesheets.

For me, no Java code is generated...
Isn't it possible ?
How does Cocoon deal with all these built-in stylesheets ? A global stylesheet with 
"xsl:import" or "xsl:include" ? Is there a requiered order of declaration in cocoon.xconf 
to be able to cross-use taglibs ?

Thanks in advance !

-- 
Olivier BILLARD


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


Re: Using built-in stylesheets tags in other built-in stylesheets

Posted by Olivier Billard <ob...@rennes.jouve.fr>.
Hi Chris !

Thanks for your answer,
I finally found an answer in the cocoon-dev list : I missed an <xsl:copy> element in the 
template that matches all other tags :

   <xsl:template match="@*|*|text()|processing-instruction()" priority="-2">
      <xsl:copy>  <-- this one
         <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
      </xsl:copy>
   </xsl:template>


Thanks again,

--
Olivier Billard



C Bram Dit Saint Amand wrote:

> If I understood your problem correctly, you're having a few difficulties
> using cocoon-specific taglibs (like esql) inside custom logicsheets?
> 
> I've done this quite easily, I just had to add the needed 'imports' (i.e.
> xmlns:WHATEVER) at the opening <xsl:stylesheet> tag of the custom
> logicsheet.
> 
> 
> Sample code from a custom logicsheet named 'chris-perso':
> ----
> <?xml version="1.0"?>
> 
> <xsl:stylesheet
>   xmlns:chris-perso="http://www.prs-ltsn.leeds.ac.uk/chris-perso"
>   xmlns:sql="http://www.prs-ltsn.leeds.ac.uk/sql"
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>   xmlns:xsp="http://apache.org/xsp"
>   xmlns:esql="http://apache.org/cocoon/SQL/v2"
>   xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>   xmlns:xsp-session="http://apache.org/xsp/session/2.0"
>   create-session="true"
>   version="1.0">
> 
> 
>     <xsl:template match="chris-perso:last-viewed-docs">
> 
>     <!-- The following tag is another custom logicsheet, the name is quite
> badly chosen though... -->
>         <sql:generic-query>
> 
> 
>             <esql:query>SELECT DISTINCT C.AccessedRelativeURL,
> C.AccessDateTime, U.Reference FROM Connections C, UrlReference U WHERE
> C.AccessedRelativeURL = U.RelativeURL AND C.SessionID =
> '<xsp-session:get-id/>' ORDER BY C.AccessDateTime DESC;</esql:query>
>             <esql:results>
>               <rowset-last-viewed-docs>
>                 <esql:row-results>
>                   <row-last-viewed-docs>
>                     <esql:get-columns/>
>             	  </row-last-viewed-docs>
>                 </esql:row-results>
>               </rowset-last-viewed-docs>
>             </esql:results>
>         </sql:generic-query>
>     </xsl:template>
> 
> </xsl:stylesheet>
> ----
> 
> 
> I hope it helps...
> 
> 
> /Chris


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


Re: Using built-in stylesheets tags in other built-in stylesheets

Posted by C Bram Dit Saint Amand <sc...@comp.leeds.ac.uk>.
If I understood your problem correctly, you're having a few difficulties
using cocoon-specific taglibs (like esql) inside custom logicsheets?

I've done this quite easily, I just had to add the needed 'imports' (i.e.
xmlns:WHATEVER) at the opening <xsl:stylesheet> tag of the custom
logicsheet.


Sample code from a custom logicsheet named 'chris-perso':
----
<?xml version="1.0"?>

<xsl:stylesheet
  xmlns:chris-perso="http://www.prs-ltsn.leeds.ac.uk/chris-perso"
  xmlns:sql="http://www.prs-ltsn.leeds.ac.uk/sql"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xsp="http://apache.org/xsp"
  xmlns:esql="http://apache.org/cocoon/SQL/v2"
  xmlns:xsp-request="http://apache.org/xsp/request/2.0"
  xmlns:xsp-session="http://apache.org/xsp/session/2.0"
  create-session="true"
  version="1.0">


    <xsl:template match="chris-perso:last-viewed-docs">

    <!-- The following tag is another custom logicsheet, the name is quite
badly chosen though... -->
        <sql:generic-query>


            <esql:query>SELECT DISTINCT C.AccessedRelativeURL,
C.AccessDateTime, U.Reference FROM Connections C, UrlReference U WHERE
C.AccessedRelativeURL = U.RelativeURL AND C.SessionID =
'<xsp-session:get-id/>' ORDER BY C.AccessDateTime DESC;</esql:query>
            <esql:results>
              <rowset-last-viewed-docs>
                <esql:row-results>
                  <row-last-viewed-docs>
                    <esql:get-columns/>
            	  </row-last-viewed-docs>
                </esql:row-results>
              </rowset-last-viewed-docs>
            </esql:results>
        </sql:generic-query>
    </xsl:template>

</xsl:stylesheet>
----


I hope it helps...


/Chris


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