You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Mark Washeim <es...@canuck.com> on 2000/06/25 18:07:49 UTC
SQL and the xspCurrentNode
Incidently, for those of you wondering how to do validation with the sql
taglib, try:
<ANELEMENT>
<sql:execute-query>
&connection;
<sql:doc-element>LOGIN</sql:doc-element>
<sql:row-element>MEMBER</sql:row-element>
<sql:tag-case>upper</sql:tag-case>
<sql:max-rows>1</sql:max-rows>
<sql:null-indicator>yes</sql:null-indicator>
<sql:query>
select FIRSTNAME, LASTNAME from TABLE where PASSWORD
='<xsp:expr>callBeanHash( request.getParameter("pwd"))</xsp:expr>'
</sql:query>
</sql:execute-query>
<xsp:expr>validate( document, xspCurrentNode , request,
session)</xsp:expr>
</ANELEMENT>
Where the validate member method operates on the current node, ANELEMENT . .
. this works well, since, at run-time, the element's children are populated
in order ...
A nice by-product of this is that you don't have to worry about context . .
. just the node at hand . . .
--
Mark (Poetaster) Washeim
'On the linen wrappings of certain mummified remains
found near the Etrurian coast are invaluable writings
that await translation.
Quem colorem habet sapientia?'
Evan S. Connell