alfonsodg / demo-web2py

Apache License 2.0
0 stars 0 forks source link

"checked" and "selected" are valid HTML attributes #8

Closed alfonsodg closed 10 years ago

alfonsodg commented 10 years ago

From mmoore9...@gmail.com on June 08, 2008 14:11:32

What steps will reproduce the problem? 1. Upload the attached application with web2py.

  1. Use your favorite browser to view the 'bad_xml' application[1].
  2. Observe failure (invalid XML).
  3. For extra credit, paste the output into the W3C XML Validator[2], and observe the "Failed validation, 4 Errors" result. What is the expected output? What do you see instead? I would expect well formed XML (e.g. passes W3C validation).

    print TAG.root(TAG.option_(_value=0, _checked=None))

  Renders: '''<root><option checked value="0"/></root>'''

To be valid XML, the 'checked' attribute needs to be followed by an equal sign and a quoted value. (See XML Attribute definition.[3])

A better approach might be to drop the attribute for any attribute that has a value of 'None' because that would be semantically the same as a missing attribute. What version of the product are you using? On what operating system? * Web2py/VERSION: Version 1.34 (2008-05-22 08:56:38)

Attachment: web2py.app.bad_xml.tar

Original issue: http://code.google.com/p/web2py/issues/detail?id=8

alfonsodg commented 10 years ago

From massimod...@gmail.com on June 08, 2008 12:44:41

That is necessary to make OPTION "selected" attributes which are valid HTML http://www.w3.org/TR/html401/interact/forms.html#adef-selected

Summary: "checked" and "selected" are valid HTML attributes

alfonsodg commented 10 years ago

From massimod...@gmail.com on June 08, 2008 12:50:58

That is necessary to make OPTION "selected" attributes which are valid HTML http://www.w3.org/TR/html401/interact/forms.html#adef-selected

Status: WontFix

alfonsodg commented 10 years ago

From mmoore9...@gmail.com on June 10, 2008 01:48:01

Massimo,

Are you going to open this back up? ;o)

-MM