cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Naquin, Beth" <Beth.Naq...@morpho.com>
Subject RE: problem with dynamic parameters in XSP + ESQL
Date Fri, 16 Aug 2002 17:51:05 GMT
I think I did something similar with a stylesheet.  I'm not sure if this is
quite what you want, but here's what I did:
 
I had a logicsheet that used esql which results in xml like this:
 
<row>
    <pin>11111</pin>
    <other_info>info</other_info>
    <more_info>more</more_info>
</row>
<row>
    <pin>21111</pin>
    <other_info>info2</other_info>
    <more_info>more2</more_info>
</row>
 
This was to go in a table like:
PIN            Info                More
1111        info                    more
2111        info1                   more2
 
where each entry in the pin column is a link to more detail for that pin
 
I made the table rows and the links with this xsl stylesheet:
 
----------------------------------------------------------------------------
-----
<!-- Format each row of a generic Data Table -->
    <xsl:template match="row">
      <tr>
         <xsl:for-each select="./child::*">
         <xsl:choose>
         <!-- make pin column a link to the person data page -->
         <xsl:when test="name()='pin'">
          <td align="right">
           <a>
           <xsl:attribute name="href">
              <xsl:value-of
select="concat('form_person_data_input.html?xlpin=',.,'&amp;constraint=&amp;
stylesheet=person_data')"/>
           </xsl:attribute>
     <!-- text that will be the link -->
           <xsl:value-of select="." />
           </a>
     
          </td>
         </xsl:when>
         <xsl:otherwise>
       <td align="right"><xsl:value-of select="." /></td>
      </xsl:otherwise>
      </xsl:choose>
        </xsl:for-each>
  </tr>
    </xsl:template>

 
 -----Original Message-----
From: Georg Spar [mailto:info@sparg.de]
Sent: Friday, August 16, 2002 9:03 AM
To: cocoon-users@xml.apache.org
Subject: problem with dynamic parameters in XSP + ESQL



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Hi @ll,
 
I 've got a problem with dynamic parameters in an XSP-ESQL-Combined
Page.
What I want to do:
I just want to write a dynamically generated XSP-Page which put out
the results of an ESQL-Query in a html-table. Each row of the table
should have one <td>-tag with a link to another XSP-Page, where the
user can view the whole entry of the database, and a few other
<td>-tags only to inform the user.
 
In a scripting language like PHP this could be done very simple, the
link look like that:
http://show.xsp?mid <http://show.xsp?mid> =<? $mid ?> where $mid is the
specific ID of the
entry in the database-table 
 
How is this be done in Cocoon? 
 
I tried several ways, first I simply tried to put the string in the
href-parameter of <xsp-session:encode-url>, but in a tag you can't
use a '<'-Sign, so the esql-variable can't be put in.
 
Then I tried some substitutions with XSL-Templates, doesn't work to.
 
Then I  want to use actions, but the result-page does not contain any
parameters.
 
So I'm very confused now. Can somebody help me, please?
 
Thanks for every idea
Georg
 
PS: @Christian Haul: I've solved the last problem on my own. There
was no problem with ESQL and nested queries, the only problem was
that Cocoon starts counting esql-fields with "1" and not with "0" ;-)
 
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use < http://www.pgp.com
<http://www.pgp.com> >
 
iQA/AwUBPV0iQaID3cBIHLXcEQIB+QCeLoaKg8jMRzgezkRWLgykcYvso8wAoM8V
ytbo8R5hgXc0n+NvDH7Wfdkt
=KIpf
-----END PGP SIGNATURE-----



Mime
View raw message