[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 </dtml-let> before
the <dtml-elif>.
<br>if you change the indenting like this:
<br><dtml-let fname="_.string.split(myfile.filename,'\\')[-1]">
<br><dtml-let filename="_.string.split(fname,'.html')[0]">
<p><dtml-if expr="filename[3:6]=='do_'">
<br> <dtml-let dir="do_">
<br> <dtml-elif expr="filename[3:6]=='aa_'">
<br> <dtml-let dir="aa_">
<br>
<dtml-else>
<br>
<dtml-let dir="vth">
<br>
<dtml-with avc>
<br>
<dtml-call
<br>
expr="dir.manage_addDTMLDocument(filename,mytitle)">
<br>
</dtml-with>
<br>
</dtml-let>
<br></dtml-if>
<p>notice that I haven't added anything but whitespace.
<br>but say that the <dtml-if> resolves to 'TRUE', it enters the
<dtml-let> block
<br>and the first tag is a <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><dtml-var standard_html_header>
<p><h2><dtml-var title></h2>
<p><dtml-let fname="_.string.split(myfile.filename,'\\')[-1]">
<br><dtml-let filename="_.string.split(fname,'.html')[0]">
<p><dtml-if expr="filename[3:6]=='do_'"><dtml-let dir="do_">
<br><dtml-elif expr="filename[3:6]=='aa_'"><dtml-let dir="aa_">
<br><dtml-else><dtml-let dir="vth">
<p><dtml-with avc>
<br><dtml-call
<br> expr="dir.manage_addDTMLDocument(filename,mytitle)">
<br></dtml-with>
<p></dtml-let>
<br></dtml-if>
<p></dtml-let>
<br></dtml-let>
<p><dtml-var showFiles>
<br><dtml-var standard_html_footer>
<br>-------
<br>with error message:
<br>Unexpected tag, for tag <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>--
Don't let rationalization stand in the way of your paranoia.
Jason Bush | jason@nol.org
Nebraska Online | <A HREF="http://www.nol.org">http://www.nol.org</A></pre>
</html>
--------------C768EE1171C4108E2863D666--