cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luca Morandini" <l.mo...@tin.it>
Subject RE: Applying custom style sheets before logicsheets [HELP!]
Date Sun, 16 Dec 2001 10:36:14 GMT
Wolfram,

I implemented the idea of dinamycally building XSPs from XSLs, and I built
an example, which I can provide to anyone interested.

On the other hand, generating XSP on-the-fly means XSP gets compiled every
time it is called, with obvious performance penalties.

Since XSP has these limitations, I decided to use transformers and rely on
stylesheets as much as possible... so far my application can nicely do
without XSP.

Just my 1.1c (after tax)... best regards,


---------------------------------------------
               Luca Morandini
               GIS Consultant
              lmorandini@ieee.org
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------


> -----Original Message-----
> From: Wolfram Eisert [mailto:wolframeisert@gmx.de]
> Sent: Sunday, December 16, 2001 11:13 AM
> To: cocoon-users@xml.apache.org
> Subject: RE: Applying custom style sheets before logicsheets [HELP!]
>
>
> Hi,
>
> you can first build your xsp in a seperate pipeline and use
> this result as a source for your serverpages-processing.
>
> Example:
>
> <map:pipeline internal-only="true">
> 	<map:match pattern="build_xsp">
> 		<map:generate src="build_xsp_src.xml"/>
> 		<map:transform src="build_xsp_transform.xsl"/>
> 		<map:serialize type="xml"/>
> 	</map:match>
> </map:pipeline>
>
> <map:pipeline>
> 	<map:match pattern="test.xml">
> 		<map:generate type="serverpages" src="cocoon:/build_xsp"/>
> 		<map:transform src="xsp_transform.xsl"/>
> 		<map:serialize type="html"/>
> 	</map:match>
> </map:pipeline>
>
> Hope this helps!
>
> Wolfram
>
> > -----Urspr√ľngliche Nachricht-----
> > Von: list@keeper2k1.fsnet.co.uk [mailto:list@keeper2k1.fsnet.co.uk]
> > Gesendet: Samstag, 15. Dezember 2001 21:35
> > An: cocoon-users@xml.apache.org
> > Betreff: Applying custom style sheets before logicsheets [HELP!]
> >
> >
> > Hi,
> >
> > This question may seem very simple, but bear with me as I am
> > quite new to cocoon.
> >
> > I am using Cocoon 2.  I have an XSP page [testdb.xsp], and want
> > to pass this through a stylesheet [testdb.xsl], then apply the
> > built-in cocoon 2 logic sheets [particularly the esql], apply a
> > xml to html stylesheet and then serialize as html.  What do I
> > have to do to make this work?
> >
> > I have started by placing using esql from the testdb.xsp directly
> > - this works as expected.  Trouble is, I want the SQL queries to
> > be "generated" by the testdb.xsl stylesheet, so removing the esql
> > from testdb.xsp and making the testdb.xsl generate them instead
> > does not "execute" them - they stay as <esql:...> even in the
> > outputted html.
> >
> > I have tried many things, such as adding/removing the esql
> > namespace from the start of the original xsp document, the xsp
> > generated from testdb.xsl, etc, the files below are what are
> > "known" to not work.  I think it is just something very simple
> > that I am missing...
> >
> > Here is the relevant part of the sitemap:
> >    <map:match pattern="testdb">
> >      <map:generate type="serverpages" src="testdb.xsp"/>
> >      <map:transform src="testdb.xsl"/>
> >      <map:transform src="table.xsl"/>
> >      <map:transform src="stylesheets/dynamic-page2html.xsl"/>
> >      <map:serialize/>
> >    </map:match>
> >
> > testdb.xsl:
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> >
> >
> > <xsl:stylesheet
> >     version="1.0"
> >     xmlns:xsp="http://apache.org/xsp"
> >     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >     xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> >     xmlns:esql="http://apache.org/cocoon/SQL/v2"
> > >
> >
> > <xsl:template match="/">
> >   <xsp:page>
> >     <xsl:apply-templates/>
> >   </xsp:page>
> > </xsl:template>
> >
> >   <xsl:template match="data-display">
> >     <esql:connection>
> >       <esql:pool>personnel</esql:pool>
> >       <esql:execute-query>
> >         <xsl:apply-templates select="query"/>
> >         <xsl:apply-templates select="display"/>
> >       </esql:execute-query>
> >     </esql:connection>
> >   </xsl:template>
> >
> >
> >   <xsl:template match="query">
> >         <esql:query>
> > 	  <xsl:value-of select="."/>
> > 	</esql:query>
> >   </xsl:template>
> >
> >   <xsl:template match="display">
> >     <esql:results>
> >       <xsl:apply-templates/>
> >     </esql:results>
> >   </xsl:template>
> >
> >   <xsl:template match="display-table">
> >     <br/>
> >     <table>
> >       <header>
> >         <xsl:for-each select="column">
> >           <cell>
> >   	    <text>
> > 	      <xsl:value-of select="title"/>
> > 	   </text>
> >           </cell>
> >         </xsl:for-each>
> >       </header>
> >
> >       <!-- header finished, now the data -->
> >
> >       <body>
> >         <esql:row-results>
> >           <row>
> >             <xsl:for-each select="column">
> >     	      <cell>
> > 	        <!-- make a reference to the action here -->
> > 		<action>
> >                   <xsl:value-of select="action/@name"/>
> > <xsl:value-of select="action/@key"/>
> > 		</action>
> > 	        <text>
> >                   <xsl:value-of select="data/@source"/>
> > 		  <xsl:value-of select="text"/>
> > 		</text>
> > 	      </cell>
> > 	    </xsl:for-each>
> >           </row>
> >         </esql:row-results>
> >       </body>
> >     </table>
> >   </xsl:template>
> >
> >   <xsl:template match="@*|node()" priority="-1">
> >     <xsl:copy>
> >       <xsl:apply-templates select="@*|node()"/>
> >     </xsl:copy>
> >   </xsl:template>
> >
> > </xsl:stylesheet>
> >
> > testdb.xsp:
> > <?xml version="1.0"?>
> >
> > <xsp:page language="java"
> >   xmlns:xsp="http://apache.org/xsp"
> >   >
> >   <page>
> >     <title>Test</title>
> >
> >     <data-display>
> >       <query>SELECT uid, userid, password FROM users</query>
> >       <display>
> >         <display-table>
> >           <column>
> > 	    <title>Username</title>
> > 	    <data source="userid"/>
> > 	  </column>
> > 	  <column>
> > 	    <title>Password</title>
> > 	    <action name="view" key="uid"/>
> > 	    <data source="password"/>
> > 	  </column>
> > 	  <column>
> >             <title></title>
> > 	    <action name="delete" key="uid"/>
> > 	    <text>delete</text>
> > 	  </column>
> >         </display-table>
> >       </display>
> >     </data-display>
> >   </page>
> > </xsp:page>
> >
> > thanks for any help,
> >
> >
> >
> >
> >
> > _______________________________________________________________________
> > Never pay another Internet phone bill!
> > Freeserve AnyTime, for all the Internet access you want, day and
> > night, only £12.99 per month.
> > Sign-up at http://www.freeserve.com/time/anytime
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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>
> >
> >
>
>
> ---------------------------------------------------------------------
> 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>
>
>


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