"select multiple" line in small template fails with bad token...

13 views
Skip to first unread message

flobro30101

unread,
Mar 21, 2014, 9:13:35 AM3/21/14
to gen...@googlegroups.com
Trying to generate a list of files by passing a simple list into this template (it fails):

<html py:strip="True" xmlns:py="http://genshi.edgewall.org/">
<select multiple name="files" id="files" >
    <py:for each="file in flist">
        <option value="${file}">${file}</option>
    </py:for>
</select>
</html>



If I remove the "multiple" from the "select" line (line 2) it works, but I do not have the correct control.


What am I doing wrong?


Thanks


Floyd

Felix Schwarz

unread,
Mar 21, 2014, 9:36:45 AM3/21/14
to gen...@googlegroups.com
Am 21.03.2014 14:13, schrieb flobro30101:
> Trying to generate a list of files by passing a simple list into this template
> (it fails):
>
(...)
> <select multiple name="files" id="files" >
(...)
>
> If I remove the "multiple" from the "select" line (line 2) it works, but I do
> not have the correct control.

Genshi templates are real XML, not HTML. In XML an attribute without a value
"multiple" is invalid.

So you can do something like
multiple="multiple"

Generally for attributes without value in HTML check what the XHTML form is.

Felix

Floyd Brown

unread,
Mar 21, 2014, 10:07:56 AM3/21/14
to gen...@googlegroups.com
Thank you for the insight. It never occurred to me to put a bogus attribute in, but it works great.

Floyd



--
You received this message because you are subscribed to the Google Groups "Genshi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genshi+un...@googlegroups.com.
To post to this group, send email to gen...@googlegroups.com.
Visit this group at http://groups.google.com/group/genshi.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages