You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by bs...@studserv.uni-leipzig.de on 2006/01/19 09:17:04 UTC

Re: Lenya and DB-Query (on German)

Hello,
i've created my pipeline and put the pipeline into the sitemap.xmap (if i put
the pipeline into doctypes.xmap, then i get not any answer from the database).
The result from the database appears not in the body, but in a new page with
white background in the same window. can someone tell me, where to put my
pipeline, so that the text be showed in the body.

here my pipeline again

    <map:pipeline>
     <map:match pattern="**/test.html">
      <map:generate type="serverpages" src="xsp/test.xsp"/>
           <map:transform src="xslt/test2xhtml.xsl"/>
      <map:serialize/>
     </map:match>
    </map:pipeline>

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Lenya and DB-Query (on German)

Posted by bs...@studserv.uni-leipzig.de.
i get the same result with:


         <?xml version="1.0" encoding="ISO-8859-1" ?>
         <xsl:stylesheet version="1.0"
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         xmlns:xhtml="http://www.w3.org/1999/xhtml"
         xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
         <xsl:param name="root"/>
         <xsl:param name="document-id"/>
         <xsl:param name="language"/>

         <xsl:template name="login"/>
         <xsl:param name="users-login"/>

         <xsl:template match="content">
         <div id="test">
           <xsl:apply-templates />
         </div>
         </xsl:template>

         <xsl:template match="rank_title">
         <xsl:value-of select="."/>
         </xsl:template>
         </xsl:stylesheet>

and

         <div id="main">
           <xsl:apply-templates select="xhtml:div[@id = 'test']"/>
         </div>


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Lenya and DB-Query (on German)

Posted by so...@apache.org.
On 1/25/06, bss00ako@studserv.uni-leipzig.de
<bs...@studserv.uni-leipzig.de> wrote:
> > The easy and standard method is for "test2xhtml.xsl" to translate the
> > data to xhtml in the top level <DIV id="body">, then use the standard
> > "page2xhtml.xsl" to insert the "body" into the normal HTML.
> > "test2xhtml.xsl" should create a DIV, not HTML/BODY.
>
> so...if i understand correctly, my test2xhtml has to be:
>
>          <?xml version="1.0" encoding="ISO-8859-1" ?>
>          <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xhtml="http://www.w3.org/1999/xhtml"
> xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
>          <xsl:param name="root"/>
>          <xsl:param name="document-id"/>
>          <xsl:param name="language"/>
>
>          <xsl:template name="login"/>
>          <xsl:param name="users-login"/>
>
>          <xsl:template match="content">
>          <div id="body">
>            <xsl:apply-templates />
>          </div>
>          </xsl:template>
>
>          <xsl:template match="rank_title">
>          <xsl:value-of select="."/>
>          </xsl:template>
>          </xsl:stylesheet>
>
> and the "body" is already insered into page2xhtml.xsl:
>
>            <div id="main">
>              <xsl:apply-templates select="xhtml:div[@id = 'body']"/>
>            </div>
>
> but it doesn't work...i'm doing somethink wrong, but i don't know, what exactly
> i'm doing wrong.

 <xsl:stylesheet version="1.0"
    xmlns="http://www.w3.org/1999/xhtml"

The match is for <xhtml:div id="body">.  That line adds the "xhtml:"
prefix to all the tags.  Namespaces are meant to make you crazy.

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Lenya and DB-Query (on German)

Posted by bs...@studserv.uni-leipzig.de.
> The easy and standard method is for "test2xhtml.xsl" to translate the
> data to xhtml in the top level <DIV id="body">, then use the standard
> "page2xhtml.xsl" to insert the "body" into the normal HTML.
> "test2xhtml.xsl" should create a DIV, not HTML/BODY.

so...if i understand correctly, my test2xhtml has to be:

         <?xml version="1.0" encoding="ISO-8859-1" ?>
         <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
         <xsl:param name="root"/>
         <xsl:param name="document-id"/>
         <xsl:param name="language"/>

         <xsl:template name="login"/>
         <xsl:param name="users-login"/>

         <xsl:template match="content">
         <div id="body">
           <xsl:apply-templates />
         </div>
         </xsl:template>

         <xsl:template match="rank_title">
         <xsl:value-of select="."/>
         </xsl:template>
         </xsl:stylesheet>

and the "body" is already insered into page2xhtml.xsl:

           <div id="main">
             <xsl:apply-templates select="xhtml:div[@id = 'body']"/>
           </div>

but it doesn't work...i'm doing somethink wrong, but i don't know, what exactly
i'm doing wrong.


CuPaKoB

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Lenya and DB-Query (on German)

Posted by so...@apache.org.
On 1/20/06, bss00ako@studserv.uni-leipzig.de
<bs...@studserv.uni-leipzig.de> wrote:
> sorry, my description of the problem was not good enough. i'll try again:
>
> i've created a new document with the ID "test" and this is integrated in another
> page (i call it overview-page for now) as menu item. the test-page shows resuls
> from a database query. when i click this test-item in the menu, i want the
> contents of the "test"-page to show up in the body of the overview-page.
> However, the result is actually shown in another page (not in the
> overview-page) with white background. for example: if i click on another menu
> item (simple page, not static page or something else), which was also created
> with lenya, then i see the result in the body of the overview-page and right
> here i want to see the result from the database, when i click on the "test"
> item.
>
> here the test.xsp:
>
> -------------Begin test.xsp-------------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsp:page language="java"
> xmlns:xsp="http://apache.org/xsp"
> xmlns:esql="http://apache.org/cocoon/SQL/v2">
> <content>
> <esql:connection>
> <esql:pool>oracle_pool</esql:pool>
> <esql:execute-query>
> <esql:query>
> select RANK_TITLE from phpbb_ranks
> </esql:query>
> <esql:results>
> <esql:row-results>
> <rank_title><esql:get-string column="RANK_TITLE"/></rank_title>
> </esql:row-results>
> </esql:results>
> <esql:no-results>
> Der Query gab eine leere Liste zur?ck!
> </esql:no-results>
> <esql:error-results>
> Es ist ein Fehler bei der Anfrage aufgetreten!
> </esql:error-results>
> </esql:execute-query>
> </esql:connection>
> </content>
> </xsp:page>
> -------------End test.xsp-------------
>
>
> and here the test2xhtml.xsl:
>
> -------------Begin test2xhtml.xsl-------------
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xhtml="http://www.w3.org/1999/xhtml"
> xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
>
>
>
> <xsl:param name="root"/>
> <xsl:param name="document-id"/>
> <xsl:param name="language"/>
>
> <xsl:template name="login"/>
> <xsl:param name="users-login"/>
>
> <xsl:template match="content">
> <html>
> <body>
> <table border="1">
> <tr>
> <td><xsl:apply-templates /></td>
> </tr>
> </table>
> </body>
> </html>
> </xsl:template>
>
> <xsl:template match="rank_title">
> <xsl:value-of select="."/>
> </xsl:template>
>
> </xsl:stylesheet>
> -------------End test2xhtml.xsl-------------
>
> CuPaKoB
>
> >
> > If I am interpreting this correctly, you have the "test" DIV on the
> > response page, probably outside the BODY tags.  View the HTML source
> > of the response page.
> >
> > 1. test.xsp generates some XML.
> > 2. test2xhtml.xsl transforms the XML to XHTML, usually a named DIV:
> > <DIV name="test">My XML</DIV>
> >
> > This is typically aggregated with other XML, such as the navigation
> > elements.  That is then transformed by a step you are missing:
> > 3. page2xhtml.xsl merges the DIVs from all the content and navigation
> > XHTML, placing them on the response page where desired within the BODY
> > tags.


Same answer.  The response to your link must use a pipeline match that
aggregates the navigation and whatever else you want on the page. 
Your <map:match pattern="**/test.html"> generates the data without any
of the navigation elements, and your  "test2xhtml" creates HTML/BODY
without any navigation.  You need to modify the pipeline to aggregate
the navigation elements, and use the DIVs in your HTML/BODY during the
final transformation.

Phrased differently, your test page must recreate your overview page
replacing the content with the test data.

The easy and standard method is for "test2xhtml.xsl" to translate the
data to xhtml in the top level <DIV id="body">, then use the standard
"page2xhtml.xsl" to insert the "body" into the normal HTML. 
"test2xhtml.xsl" should create a DIV, not HTML/BODY.

Look at default xslt/page2xhtml.xsl for an example.

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Lenya and DB-Query (on German)

Posted by bs...@studserv.uni-leipzig.de.
sorry, my description of the problem was not good enough. i'll try again:

i've created a new document with the ID "test" and this is integrated in another
page (i call it overview-page for now) as menu item. the test-page shows resuls
from a database query. when i click this test-item in the menu, i want the
contents of the "test"-page to show up in the body of the overview-page.
However, the result is actually shown in another page (not in the
overview-page) with white background. for example: if i click on another menu
item (simple page, not static page or something else), which was also created
with lenya, then i see the result in the body of the overview-page and right
here i want to see the result from the database, when i click on the "test"
item.

here the test.xsp:

-------------Begin test.xsp-------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2">
<content>
<esql:connection>
<esql:pool>oracle_pool</esql:pool>
<esql:execute-query>
<esql:query>
select RANK_TITLE from phpbb_ranks
</esql:query>
<esql:results>
<esql:row-results>
<rank_title><esql:get-string column="RANK_TITLE"/></rank_title>
</esql:row-results>
</esql:results>
<esql:no-results>
Der Query gab eine leere Liste zur?ck!
</esql:no-results>
<esql:error-results>
Es ist ein Fehler bei der Anfrage aufgetreten!
</esql:error-results>
</esql:execute-query>
</esql:connection>
</content>
</xsp:page>
-------------End test.xsp-------------


and here the test2xhtml.xsl:

-------------Begin test2xhtml.xsl-------------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:i18n="http://apache.org/cocoon/i18n/2.1">



<xsl:param name="root"/>
<xsl:param name="document-id"/>
<xsl:param name="language"/>

<xsl:template name="login"/>
<xsl:param name="users-login"/>

<xsl:template match="content">
<html>
<body>
<table border="1">
<tr>
<td><xsl:apply-templates /></td>
</tr>
</table>
</body>
</html>
</xsl:template>

<xsl:template match="rank_title">
<xsl:value-of select="."/>
</xsl:template>

</xsl:stylesheet>
-------------End test2xhtml.xsl-------------

CuPaKoB

>
> If I am interpreting this correctly, you have the "test" DIV on the
> response page, probably outside the BODY tags.  View the HTML source
> of the response page.
>
> 1. test.xsp generates some XML.
> 2. test2xhtml.xsl transforms the XML to XHTML, usually a named DIV:
> <DIV name="test">My XML</DIV>
>
> This is typically aggregated with other XML, such as the navigation
> elements.  That is then transformed by a step you are missing:
> 3. page2xhtml.xsl merges the DIVs from all the content and navigation
> XHTML, placing them on the response page where desired within the BODY
> tags.
>
> solprovider
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Lenya and DB-Query (on German)

Posted by so...@apache.org.
On 1/19/06, bss00ako@studserv.uni-leipzig.de
<bs...@studserv.uni-leipzig.de> wrote:
> i've created my pipeline and put the pipeline into the sitemap.xmap (if i put
> the pipeline into doctypes.xmap, then i get not any answer from the database).
> The result from the database appears not in the body, but in a new page with
> white background in the same window. can someone tell me, where to put my
> pipeline, so that the text be showed in the body.
> here my pipeline again
>     <map:pipeline>
>      <map:match pattern="**/test.html">
>       <map:generate type="serverpages" src="xsp/test.xsp"/>
>            <map:transform src="xslt/test2xhtml.xsl"/>
>       <map:serialize/>
>      </map:match>
>     </map:pipeline>

If I am interpreting this correctly, you have the "test" DIV on the
response page, probably outside the BODY tags.  View the HTML source
of the response page.

1. test.xsp generates some XML.
2. test2xhtml.xsl transforms the XML to XHTML, usually a named DIV:
<DIV name="test">My XML</DIV>

This is typically aggregated with other XML, such as the navigation
elements.  That is then transformed by a step you are missing:
3. page2xhtml.xsl merges the DIVs from all the content and navigation
XHTML, placing them on the response page where desired within the BODY
tags.

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org