Hi All

I have a question regarding the use and purpose of XSP.  I believe that XSP is an 
attempt to separate content/logic from presentation, and I believe it's possible to 
use it in this way. However, in many of the samples (such as results-dept.xsp below, 
found in the tutorial) XSP is used to retrieve XML from a database and wrap it in some 
sort of pseudo-html, which is then processed by a logicsheet to produce proper HTML. 
To me this defeats the whole purpose of XSP. The XSP below mixes content and 
presentation, and if it contained <xsp:logic> sections it would be even worse, mixing 
content, logic and presentation.

My thoughts are that, as the XSP is a generator it should generate XML in some 
suitable form. If logic is needed within the XSP dynamic tags can be used and 
translated using a logicsheet (or made part of XSP if they are not resuable). However, 
the actual presentation of this XML should be left to a stylesheet.

I would really appreciate your comments and thoughts on this as we are trying to 
implement multiple projects here using Cocoon and want to use a consistent, 
best-practise approach.

Thanks for your time :-)

Michael

<xsp:page xmlns:xsp="http://apache.org/xsp";
          xmlns:xsp-request="http://apache.org/xsp/request/2.0";
          xmlns:esql="http://apache.org/cocoon/SQL/v2";>
  <document>
    <header>
      <title>Search Results</title>
    </header>
    <body>
      <s1 title="Department Search Results">
        <p>
          You can edit a department by clicking on the "edit"
          button, and you can delete a department by clicking on
          the "delete" button.
        </p>
          <esql:connection>
            <esql:pool>personnel</esql:pool>
            <esql:execute-query>
              <esql:query>
                SELECT id, name FROM department
                WHERE name LIKE <esql:parameter>%<xsp-request:get-parameter 
name="name"/>%</esql:parameter>
                ORDER BY name
              </esql:query>
              <esql:results>
                <esql:row-results>
                  <s2>
                  <xsp:attribute name="title"><esql:get-string 
column="name"/></xsp:attribute>
                  <form handler="edit-dept.html">
                    <xsp:attribute name="name"><esql:get-string 
column="id"/></xsp:attribute>
                    <p>
                      <parameter name="id">
                        <xsp:attribute name="value"><esql:get-string 
column="id"/></xsp:attribute>
                      </parameter>
                      <submit name="Edit Department"/><submit name="Delete 
Department"/>
                    </p>
                  </form>
                  </s2>
                </esql:row-results>
              </esql:results>
                <esql:no-results>
                  <p>
                    We could find any departments that matched your search
                    criteria of "<xsp-request:get-parameter name="name"/>".
                    <link href="search-dept.html">Go back and try again?</link>
                  </p>
                </esql:no-results>
            </esql:execute-query>
          </esql:connection>
      </s1>
    </body>
  </document>
</xsp:page>

-----------------------------------------------
Michael Edge
Global Markets Technology
Institutional Client Group

Phone:  +44  (0) 20 7545 3204
Fax :       +44  (0) 20 7545 1559
Internet email:    [EMAIL PROTECTED]


--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to