[Zope] Question of the week

Casey Duncan cduncan@kaivo.com
Mon, 18 Jun 2001 09:44:26 -0600


> Eric Vautour wrote:
> 
> Hello all, I sent this to the forem by mistake, and I got flack
> because of it, hopefully it reaches the right place this time.
>  I have a question that may or may not be answerable.  I have a site
>  that is set up as so:
> 
> There is a something.htm that calles other objects, like so:
> 
>  <dtml-var level1_header>
>  <dtml-var level1_sidebar>
>  <dtml-var l1_phoneit>
>  <dtml-var l1_dialit>
>  <dtml-var l1_findit>
>  <dtml-var level1_footer>
> 
> I was wondering if there was a way that I could extract the
> information from this ".htm" object so that I could determine which
> objects are being called from it, excluding the header, footer, and
> sidebar.
> 
> Is this possable?
> 
> Thanks

It is possible if you use the DTML parser from an external method. It
returns a list of blocks representing the tags in a parsed form. You
could in theory loop through this parsed data and extract the names of
the called objects.

Take a look at the parse method of the DT_String module in
lib/python/DocumentTemplate. DTML Docs and methods subclass the String
class, so you could call it externally on these objects.

BTW: Please don't post HTML messages to the list. You will get less flak
and more responses with plain text.
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>