Another usage of this tag is to set the parameters of a query based on the is 
in <esql:query> see the example:

<esql:query>
  SELECT usr_name, usr_full_name, usr_password FROM users
  WHERE usr_id =
  <esql:parameter type="int">
    <xsp:expr>
      Integer.parseInt(
        <xsp-session:getxml context="authentication" path="/authentication/ID" 
as="string"/>)
    </xsp:expr>
  </esql:parameter>
</esql:query>

Antonio Gallardo

El Martes, 08 de Octubre de 2002 05:43, Antonio Gallardo Rivera escribió:
> Hi, I recently needed to write some app logi usin <xsp:logic> tags. Into
> tags we need to write some code like:
>
> String myUserID = <xsp-session:getxml context="authentication"
> path="/authentication/ID" as="string"/>;
>
> Then, I updated <xsp-session:getxml> to serve strings.
>
> Currently the attribute "as" of the element can have 3 values:
>
> 1-as="object" (default) returns a org.w3c.dom.DocumentFragment object. More
> info at
> http://xml.apache.org/xerces2-j/javadocs/api/org/w3c/dom/DocumentFragment.h
>tml
>
> 2-as="xml" return the DocumentFragment into <xsp-session:xml> tags.
>
> 3- return the value of the firstchild of the requested node. Example: If we
> have:
>
> <ID>MyID</ID>
> <role>MyRole</role>
> <data>
> <fullname>TheFullName</fullname>
>
> A) Then if we write:
> <xsp-session:getxml context="authentication" path="/authentication/ID"
> as="string"/>
>
> will return "MyID"
>
> B) <xsp-session:getxml context="authentication"
> path="/authentication/data/fullname" as="string"/>
>
> will return: "TheFullName"
>
> Attached is the new session.xsl the place of this file is:
>
> xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java
>
> Antonio Gallardo

---------------------------------------------------------------------
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