Community
Participate
Working Groups
The doc for IMemento says that any alphanumeric string is acceptable as a key. If . is legitimate, and we know it is, why is # illegitimate? If nothing else, the doc needs to be more specific.
Using string numbers like "0" as keys is not legitimate too. Throws INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified. Seems like key should be a valid XML name.
Update javadoc, see bug 207773 PW
Created attachment 164872 [details] doc update v01 What we used to say: "The key for an attribute may be any alpha numeric value." which is technically [A-Za-z0-9]. But we're backed by XML (as specified in IMemento) so we allow XML Names. I propose: "The key for an attribute may be any alpha numeric value that doesn't start with a number, or a valid XML <a href="http://www.w3.org/TR/REC-xml/#NT-Name">Name</a>." The alternative is to specify something like: "The key for an attribute may be any alpha numeric value that doesn't start with a number. As long as IMemento uses the external storage format based on XML it will also accept valid XML <a href="http://www.w3.org/TR/REC-xml/#NT-Name">Name</a>." Boris, John, do you have a preference? PW
I wouldn't want to have the implementation leak through - who knows, maybe we'll want to use JSON one day. If you rely on the fact that the current implementation allows "." in keys then this is not backed by the API specification. How about just fixing the documentation by saying "The key for an attribute may be any non-empty alphanumeric value that starts with a letter: [A-Za-z][A-Za-z0-9]*"?
(In reply to comment #4) > How about just fixing the documentation by saying "The key for an attribute may > be any non-empty alphanumeric value that starts with a letter: > [A-Za-z][A-Za-z0-9]*"? I'm fine with that ... except we do specify that this is backed by XML in our API. OK, maybe something like: "The key for an attribute may be any alpha numeric value that doesn't start with a number. eg: [A-Za-z][A-Za-z0-9]* Using '.' is unsupported." There are a couple of bugs like bug 50373 that ask for the ability to back an IMemento by something other than XML and bug 207773 where we throw a DOMException and should expose it in the IMemento interface (or stop doing that). PW
Released for I20100520-0800 PW
In I20100520-1744 PW