cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leona Slepetis <LSlepe...@alliancetech.com>
Subject RE: storing result of <esql:get-xml>
Date Fri, 06 May 2005 21:09:43 GMT


"Nathaniel Alfred" <Alfred.Nathaniel@swx.com> wrote on 05/02/2005 03:13:37
PM:

> >-----Original Message-----
> >From: Leona Slepetis [mailto:LSlepetis@alliancetech.com]
>
> Try the following:
>
> >I would like: (what is the type of myVar?)
> >...
> String myVar;
> ><esql:execute-query>
> >  <esql:query>
> >    select text
> >    from sur_response
> >  </esql:query>
> >  <esql:results>
> >    <esql:row-results>
> >      <xsp:logic>
> >        myVar = <esql:get-xml column="text"/>;
>          myVar = <esql:get-string column="text"/>;
> >      </xsp:logic>
> >    </esql:row-results>
> >  </esql:results>
> ></esql:execute-query>
> ><TABLE>
> >  <TR>
> >    <TD><xsp:expr>myVar</xsp:expr></TD>
>      <TD><util:include-expr xmlns:util="http://apache.org/xsp/util/2.0
> " expr="myVar"/></TD>
> >  </TR>
> >  <TR> ... some other queries go here ... </TR>
> >  <TR>
> >    <TD><xsp:expr>myVar</xsp:expr></TD>
> >  </TR>
> ></TABLE>
> >...
> >
> >Thanks,
> >Leona
>
> HTH, Alfred.
>

Alfred,

Thanks. That was part of the solution; I had to solve an additional problem
to get it working.

My new code has:

<!-- in the root element -->
xmlns:util="http://apache.org/xsp/util/2.0"

<!-- in the query -->
<esql:row-results>
  <xsp:logic>
  strWelcomeText = <esql:get-string column="welcome_text"/>;
  </xsp:logic>
</esql:row-results>

<!-- in each place where I want the output -->
<util:include-expr>

<util:expr><xsp:logic>"&lt;at>"+strWelcomeText+"&lt;/at>"</xsp:logic></util:expr>
</util:include-expr>

You will notice that I am wrapping my String with "<at>". It doesn't matter
what this tag is, it just helps make the output be well-formed.

Without the enclosing tag, I would get "SAXParseException: Content is not
allowed in prolog."

Regards,
Leona



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message