History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: STS-339
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Ben Gunter
Reporter: Philip Savkin
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Stripes

Incorrect XHTML ID attridute

Created: 01/Mar/07 02:32 AM   Updated: 30/Apr/07 05:29 AM
Component/s: Tag Library
Affects Version/s: Release 1.4.2
Fix Version/s: Release 1.4.3

File Attachments: 1. Text File InputTagSupport.patch.txt (0.6 kb)



 Description  « Hide
Stripes generates incorrect XHTML ID attributes for form tags. According to specification the ID attribute must not start with a digit or '-' sign. As a result, W3C Validator Service reports incorrect XHTML. My proposal is to begin those synthetic ID's with an underscore character. Patch attached.

 All   Comments   Change History      Sort Order:
Philip Savkin [01/Mar/07 02:33 AM]
Patch for net.sourceforge.stripes.tag.InputTagSupport

Ben Gunter [04/Mar/07 05:04 PM]
I agree that it is incorrect that the IDs start with a digit, but based on what I'm reading a leading underscore wouldn't be backward compatible with HTML 4. Maybe I'm confused. If I am, please point me in the right direction so I can get this right. Here's what I see...

XHTML spec section 4.10 says, "In XML, fragment identifiers are of type ID, and there can only be a single attribute of type ID per element. Therefore, in XHTML 1.0 the id attribute is defined to be of type ID."

http://www.w3.org/TR/xhtml1/#h-4.10

XHTML spec section C.8 says, "Note that the collection of legal values in XML 1.0 Section 2.3, production 5 is much larger than that permitted to be used in the ID and NAME types defined in HTML 4. When defining fragment identifiers to be backward-compatible, only strings matching the pattern [A-Za-z][A-Za-z0-9:_.-]* should be used. See Section 6.2 of [HTML4] for more information."

http://www.w3.org/TR/xhtml1/#C_8

And finally, HTML 4 spec section 6.2 says, "ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".")."

http://www.w3.org/TR/html4/types.html#h-6.2

We should follow the suggestions in the spec to maintain backward compatibility. So I'm thinking something like "stripes:0123456789" will work. If no one objects, this is the pattern I'm going to use.

Philip Savkin [05/Mar/07 12:17 AM]
Right, underscore will not work for HTML 4, sorry, I forgot about that :) So please use your pattern.

Ben Gunter [05/Mar/07 07:19 PM]
Formats are now "stripes:" with a random int appended