your response actually outlines the reason i brought it up. although the spec uses the * notation in its definitions, it pretty clearly states:

"...to indicate that a property or child node definition is residual, the value returned by ItemDefinition.getName() is “*”. However, “*” is not a valid value for the property jcr:name in a nt:propertyDefinition or nt:childNodeDefinition node (because jcr:name it is a NAME property, not a STRING). As a result, an in- content definition of a residual item will simply not have a jcr:name property."

so, i would refute your #1 by saying that although the JCR spec is littered with *s for readability, it quite specifically doesn't imply the use of "*" as a name because it simply isn't of type name. in fact, the ebnf starting on page 67 states that a onecharsimplename, the only applicable non-terminal for a one character name, is "(* Any Unicode character except: '.', '/', ':', '[', ']', '*', ''', '"', '|' or any whitespace character *)". so i would say that it is pretty obvious that * is not used as a valid value for that attribute.

further, it seems that the only reason that new QName("", "*") doesn't fail with an exception is that "The local part is not validated as a NCName as specified in Namespaces in XML" as stated in the javadoc for QName. If it were, it would have to be either a "Letter" as defined by http://www.w3.org/TR/REC-xml/ or an '_'. again, it doesn't qualify.

so i guess that my point would be that i agree that neither is clearer, but i definitely question the validity. specifically, the fact that many node type definitions aren't valid under nt:nodeType is worrisome.

now, of course this isn't detrimental, but if future revisions opt to start type-checking in appropriate places, it could be a mess. but if there is a better reason for the * than it was chosen to be implemented as such, i could certainly reconsider my position.

thanks for hearing me out,

greg kick
http://kickstyle.net/



On Apr 15, 2006, at 12:38 AM, Jukka Zitting wrote:

Hi,

On 4/15/06, Greg Kick <[EMAIL PROTECTED]> wrote:
i have a quick question about node type definitions.  jackrabbit
consistently (NodeTypeWriter, custom_nodetypes.xml, etc.) uses
name="*" for residual definitions in the xml format.  however, p. 144
of the jsr170 spec says that * is not a valid name and the attribute
should be dropped for residual definitions.  so the question is
whether it was used on purpose in jackrabbit or if this is a
mistake.  i haven't looked at the code much, but it seems like it
would actually be harder to implement with the * than without...
anyway, a little insight would be appreciated because googleing the
archives gave me nothing.

It is arguable whether name="*" or no name attribute is clearer, but
both are valid solutions as there is no fear of collision between "*"
and any valid property name. I suppose the main reasons for using "*"
is that 1) the JCR specification uses "*" as the "name" of residual
definitions, and that 2) the Jackrabbit internals use the
ItemDef.ANY_NAME constant (defined as: new QName("", "*")) to identify
residual definitions.

BR,

Jukka Zitting

--
Yukatan - http://yukatan.fi/ - [EMAIL PROTECTED]
Software craftsmanship, JCR consulting, and Java development

Reply via email to