Bug 122341 - [Model] IMemento rejects keys that begin with #
Summary: [Model] IMemento rejects keys that begin with #
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 RC2   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords: Documentation
Depends on:
Blocks:
 
Reported: 2005-12-29 16:21 EST by benson margulies CLA
Modified: 2010-05-21 09:48 EDT (History)
5 users (show)

See Also:


Attachments
doc update v01 (3.01 KB, patch)
2010-04-14 14:45 EDT, Paul Webster CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description benson margulies CLA 2005-12-29 16:21:13 EST
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.
Comment 1 anatoly techtonik CLA 2007-10-29 08:59:33 EDT
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.
Comment 2 Paul Webster CLA 2010-04-12 09:40:56 EDT
Update javadoc, see bug 207773

PW
Comment 3 Paul Webster CLA 2010-04-14 14:45:08 EDT
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
Comment 4 Boris Bokowski CLA 2010-04-14 14:51:18 EDT
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]*"?
Comment 5 Paul Webster CLA 2010-04-14 15:24:02 EDT
(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
Comment 6 Paul Webster CLA 2010-05-18 09:40:56 EDT
Released for I20100520-0800
PW
Comment 7 Paul Webster CLA 2010-05-21 09:48:55 EDT
In I20100520-1744
PW