[albatross-users] al-comment tags

Sheila King sheila at thinkspot.net
Sun Oct 19 04:28:05 EST 2003


Hello,

Something I wanted to share that just occurred in code I was working on...

I'm using Albatross 1.10 with various patches that have been distributed to 
the list...

I have an html template page that I was coding various options using al-if 
structures...

After working on this page for a couple of days, I decided to cut back the 
functionality for the time being, and just present simple options and 
possibly expand to some of the more complex stuff at a later date 
(scheduling concerns...)

So I go to add al-comment tags to my code and get errors on the parse. 
Error says:

  File "/usr/lib/python2.2/site-packages/albatross/template.py", line 302, 
in __init__
    raise ApplicationError('%s:%s: "%s"; expected "%s" end tag' % 
(filename, line_num, part, parent.name))
ApplicationError: ./templates/setquestion.html:36: "/al-comment"; expected 
"al-if" end tag

(last part of the traceback)

Anyhow, the structure is something like this:

<al-comment>
<al-if expr="stuff">
more stuff here
</al-comment>

Some content in here

<al-comment>
<al-else>
more stuff..yadda
</al-if>
</al-comment>


So, I try to figure out what's wrong, and reading the docs for al-comment, 
I find the following:

"5.3.2 <al-comment>

This tag suppresses the execution and output of any contained content, 
although the contained content must be syntactically correct. "

I'm guessing my code is failing at the end of the first closing al-comment 
tag (the line number of the error corresponds to the first </al-comment> 
tag) because I have no </al-if> inside of that comment block. But that's 
because the closing </al-if> tag is later down the page and is within a 
comment block of it's own.

I have never worked with a programming language before that required stuff 
within commented blocks to be syntactically correct. I'm quite surprised at 
this behavior, as I cannot understand the reasoning for it, and it 
certainly doesn't allow me to use comments as I normally would.

Disappointed that I can't use comments as I would like to...

-- 
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org




More information about the Albatross-users mailing list