First, I don't believe that an input can have a multiple attribute. A select can. And the inverse of multiple="multiple" is not multiple="false", it's simply the absence of the multiple attribute altogether. Any string at all in the value portion of the multiple attribute will signal that the attribute is true. And in HTML5, just having it there at all will have it work. These are all functionally identical:
<select name="foo" multiple="bar">...</select>
<select name="foo" multiple="true">...</select>
<select name="foo" multiple>...</select>
<select name="foo" multiple="multiple">...</select>
The last two are considered the normal form. To make a single-value select, you would use this instead:
<select name="foo">...</select>
Walter
On May 13, 2013, at 8:20 AM, Tassadar Liu wrote:
> Here's the code:
>
> require 'nokogiri'
>
>
> doc
> = Nokogiri::HTML("<!DOCTYPE html><html><input multiple='false' id='test' some='2'/><div multiple='true'></div></html>")
>
>
> puts doc
> .
> errors
>
> doc
> .css("input").each do |el|
>
> puts el
> .attributes['multiple']
> end
>
>
> puts doc
> .to_html
>
> And here's the output:
>
> false
> <!DOCTYPE html>
> <html><body>
> <input multiple id="test" some="2"><div multiple></div>
> </body></html>
> [Finished in 2.0s]
>
> Where are the two 'false's??
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
nokogiri-tal...@googlegroups.com.
> To post to this group, send email to
nokogi...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/nokogiri-talk?hl=en.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>