Discussion:
"select multiple" line in small template fails with bad token...
flobro30101
2014-03-21 13:13:35 UTC
Permalink
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
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/genshi.
For more options, visit https://groups.google.com/d/optout.
Felix Schwarz
2014-03-21 13:36:45 UTC
Permalink
Trying to generate a list of files by passing a simple list into this template
(...)
<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
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/genshi.
For more options, visit https://groups.google.com/d/optout.
Floyd Brown
2014-03-21 14:07:56 UTC
Permalink
Thank you for the insight. It never occurred to me to put a bogus attribute
in, but it works great.

Floyd
Post by flobro30101
Post by flobro30101
Trying to generate a list of files by passing a simple list into this
template
(...)
Post by flobro30101
<select multiple name="files" id="files" >
(...)
Post by flobro30101
If I remove the "multiple" from the "select" line (line 2) it works, but
I do
Post by flobro30101
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
--
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
Visit this group at http://groups.google.com/group/genshi.
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/genshi.
For more options, visit https://groups.google.com/d/optout.
Loading...