cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <>
Subject Re: Dynamic selection list
Date Wed, 05 Jul 2006 06:32:51 GMT
Are people still writing apps in XSP?  I thought that usage
of XSP was deprecated and that it had long been supplanted 
by other, more robust, technologies and techniques.
FWIW, the way I do this is to use an SQLTransformer and 
stylesheet combo:
1.  The query (say, XYZ-lookup.xml):
<?xml version="1.0" encoding="UTF-8"?>
    <sql:query name="theme-list">
      SELECT FieldA AS id, FieldB AS data  FROM myTable
2. The stylesheet (say, keys2list.xsl):
<xsl:template match="/"><xsl:apply-templates
<xsl:template match="page">
  <xsl:apply-templates select="sql:rowset"/>
<xsl:template match="sql:rowset">
<select name="theme" class="frmField">
  <xsl:apply-templates select="sql:row"/>
<xsl:template match="sql:row"><option value="{sql:id}"><xsl:value-of
3.  And the pipeline match:
<map:match pattern="lookup-*">
  <map:generate src="queries/lookup/{1}-lookup.xml" type="jx" >
  <map:transform type="sql">
      <map:parameter name="use-connection" value="myConnection"/>
      <map:parameter name="show-nr-of-rows" value="true"/> 
      <map:parameter name="clob-encoding" value="UTF-8"/> 
  <map:transform src="stylesheets/lookup/keys2list.xsl">
  <map:serialize />
4. And the call from the form would be:
<fd:selection-list  src="cocoon:/db/lookup-XYZ" dynamic="true"/>
5. Obviously, adding new lookup lists would simply be a matter of
new XML files with new queries (using the same field renaming
so as to be able to reuse the stylesheet), named so that they can be
by the same pipeline.
Hope this helps!

>>> 2006/07/04 11:22 PM >>>

Jason Johnston wrote:
> > how to make a SQL query in javascript.
> It can be done, though the syntax isn't quite as nice.

I'd like to give it a try, if the syntax isn't unbearable.
Do you have any pointers?

Although most of all I'd rather do it in ESQL in an XSP page and then
somehow call it from javascript and get an array out of the xml
produced.  Is there a way to do that?

> But there's also JavaSelectionList, which mysteriously doesn't
> to be in the published user docs.  It sounds like this is closer to
> what you're looking for.

Thanks, that's quite fitting to what I need.  Although I'd still
do it in XSP, for consistency with all the other DB queries in this

Thinking about it, I could write an XSP-JavaSelectionList


To unsubscribe, e-mail: 
For additional commands, e-mail: 

This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
CSIR E-mail Legal Notice 
CSIR Copyright, Terms and Conditions 
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message