[Zope] SQL stored proc returns XML text; how to display in ZPT?
Dieter Maurer
dieter at handshake.de
Wed Nov 12 16:32:12 EST 2003
David Mitchell wrote at 2003-11-12 22:58 +1100:
> ...
> I've got a SQL stored procedure that returns an XML string. I've
> written a ZSQL Method "dump_xml" that calls the stored proc;
> ...
> <span tal:replace="here/dump_xml" /> This returns something like
> <Shared.DC.ZRDB.Results.Results instance at 0x9001394>
This ("Shared.DC.ZRDB.Results.Results") is the result type of
Z SQL Methods.
It behaves like a sequence of "record" objects.
A "record" provides access to the columns either by name or by index.
Thus, you can use (e.g.):
<XXX tal:define="result_sequence here/dump_xml"
tal:replace="python: result_sequence[0][0]" />
This would render field "0" of the row "0" of your Z SQL Method result.
--
Dieter
More information about the Zope
mailing list