[Zope] <dtml-elif> problem

Jason Bush jason@nol.org
Fri, 02 Aug 2002 11:52:31 -0500


--------------C768EE1171C4108E2863D666
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I believe that it is complaining that it expects to find a
</dtml-let> before the <dtml-elif>.
if you change the indenting like this:
<dtml-let fname="_.string.split(myfile.filename,'\\')[-1]">
<dtml-let filename="_.string.split(fname,'.html')[0]">

<dtml-if expr="filename[3:6]=='do_'">
   <dtml-let dir="do_">
      <dtml-elif expr="filename[3:6]=='aa_'">
         <dtml-let dir="aa_">
            <dtml-else>
               <dtml-let dir="vth">
                  <dtml-with avc>
                     <dtml-call

expr="dir.manage_addDTMLDocument(filename,mytitle)">
                  </dtml-with>
               </dtml-let>
</dtml-if>

notice that I haven't added anything but whitespace.
but say that the <dtml-if> resolves to 'TRUE', it enters the
<dtml-let> block
and the first tag is a <dtml-elif>. Thats the first thing that popped
into my head
anyhow, I've been wrong before =)>

Tom Germaine wrote:

> Hi All:
>
> I am trying to download files (with standardized filenames) to
> specific subdirectories with a form that calls a dtml document for
> processing, but the code breaks at the dtml-elif phrase:
> --------
> <dtml-var standard_html_header>
>
> <h2><dtml-var title></h2>
>
> <dtml-let fname="_.string.split(myfile.filename,'\\')[-1]">
> <dtml-let filename="_.string.split(fname,'.html')[0]">
>
> <dtml-if expr="filename[3:6]=='do_'"><dtml-let dir="do_">
> <dtml-elif expr="filename[3:6]=='aa_'"><dtml-let dir="aa_">
> <dtml-else><dtml-let dir="vth">
>
> <dtml-with avc>
> <dtml-call
>   expr="dir.manage_addDTMLDocument(filename,mytitle)">
> </dtml-with>
>
> </dtml-let>
> </dtml-if>
>
> </dtml-let>
> </dtml-let>
>
> <dtml-var showFiles>
> <dtml-var standard_html_footer>
> -------
> with error message:
> Unexpected tag, for tag <dtml-elif expr="filename[3:6]=='aa_'">
>
> However, the code function ok if dtml-elif and dtml-else lines are
> omitted.
>
> I cannot understand why and would appreciate any solutions.
>
> Tom Germaine
>
> ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
> Tom Germaine
> System Administrator
> UPEI Access Services
> tgermaine@upei.ca
> 566-0465
> ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~

--
Don't let rationalization stand in the way of your paranoia.

Jason Bush          |          jason@nol.org
Nebraska Online     |     http://www.nol.org



--------------C768EE1171C4108E2863D666
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I believe that it is complaining that it expects to find a &lt;/dtml-let>&nbsp;before
the &lt;dtml-elif>.
<br>if you change the indenting like this:
<br>&lt;dtml-let fname="_.string.split(myfile.filename,'\\')[-1]">
<br>&lt;dtml-let filename="_.string.split(fname,'.html')[0]">
<p>&lt;dtml-if expr="filename[3:6]=='do_'">
<br>&nbsp;&nbsp; &lt;dtml-let dir="do_">
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-elif expr="filename[3:6]=='aa_'">
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-let dir="aa_">
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;dtml-else>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;dtml-let dir="vth">
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;dtml-with avc>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;dtml-call
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
expr="dir.manage_addDTMLDocument(filename,mytitle)">
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/dtml-with>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/dtml-let>
<br>&lt;/dtml-if>
<p>notice that I&nbsp;haven't added anything but whitespace.
<br>but say that the &lt;dtml-if>&nbsp;resolves to 'TRUE', it enters the
&lt;dtml-let>&nbsp;block
<br>and the first tag is a &lt;dtml-elif>. Thats the first thing that popped
into my head
<br>anyhow, I've been wrong before =)>
<p>Tom Germaine wrote:
<blockquote TYPE=CITE>Hi All:
<p>I am trying to download files (with standardized filenames) to
<br>specific subdirectories with a form that calls a dtml document for
<br>processing, but the code breaks at the dtml-elif phrase:
<br>--------
<br>&lt;dtml-var standard_html_header>
<p>&lt;h2>&lt;dtml-var title>&lt;/h2>
<p>&lt;dtml-let fname="_.string.split(myfile.filename,'\\')[-1]">
<br>&lt;dtml-let filename="_.string.split(fname,'.html')[0]">
<p>&lt;dtml-if expr="filename[3:6]=='do_'">&lt;dtml-let dir="do_">
<br>&lt;dtml-elif expr="filename[3:6]=='aa_'">&lt;dtml-let dir="aa_">
<br>&lt;dtml-else>&lt;dtml-let dir="vth">
<p>&lt;dtml-with avc>
<br>&lt;dtml-call
<br>&nbsp; expr="dir.manage_addDTMLDocument(filename,mytitle)">
<br>&lt;/dtml-with>
<p>&lt;/dtml-let>
<br>&lt;/dtml-if>
<p>&lt;/dtml-let>
<br>&lt;/dtml-let>
<p>&lt;dtml-var showFiles>
<br>&lt;dtml-var standard_html_footer>
<br>-------
<br>with error message:
<br>Unexpected tag, for tag &lt;dtml-elif expr="filename[3:6]=='aa_'">
<p>However, the code function ok if dtml-elif and dtml-else lines are
<br>omitted.
<p>I cannot understand why and would appreciate any solutions.
<p>Tom Germaine
<p>~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
<br>Tom Germaine
<br>System Administrator
<br>UPEI Access Services
<br>tgermaine@upei.ca
<br>566-0465
<br>~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~</blockquote>

<pre>--&nbsp;
Don't let rationalization stand in the way of your paranoia.

Jason Bush&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jason@nol.org
Nebraska Online&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://www.nol.org">http://www.nol.org</A></pre>
&nbsp;</html>

--------------C768EE1171C4108E2863D666--