jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: residual definition xml implementation
Date Sat, 15 Apr 2006 22:05:59 GMT
Hi,

On 4/15/06, Greg Kick <gk5885@kickstyle.net> wrote:
> well, i'm glad that jackrabbit behaves correctly internally.  the
> reason i brought this up originally was because NodeTypeWriter
> creates documents with the *.  i had wanted to create an xml schema
> to check that a node definition was valid (i needed xml, not cnd).
> so, i figured that i would do it by using xslt to transform the
> definitions outputted by NodeTypeWriter into a schema, but since *
> isn't a valid NCName it would fail. so the question is, if the *
> isn't used internally, why is it reintroduced in the xml output?

The reasons I outlined before apply to the node type xml format as
well: 1) the JCR spec uses "*" as the name of residual definitions,
and 2) the internal ItemDef.ANY_NAME matches "*" in string format.

Can you use something like the following in your XSLT to cover case:

    <xsl:template match="propertyDefinition[@name='*']">
        <!-- handle residual definition -->
    </xsl:template>
    <xsl:template match="propertyDefinition">
        <!-- handle named definition -->
    </xsl:template>

+ the same for childNodeDefinition.

> can this be considered a bug or just a design choice i don't agree
> with? :-)  i'm even willing to do the work to remove it and submit a
> diff, but i don't want to go through all of the effort if there is a
> reason it is being used here...

The main reason for keeping the current internal implementation (using
ItemDef.ANY_NAME) over an alternative is that the current design is
proven to work and there is no compelling enough reason to change it.

As for the node type XML format, I wouldn't change that even if the
alternative design (not having a name attribute in residual definition
elements) was considered better or more correct. The current format
works and changing it would break backwards compatibility of the
JackrabbitNodeTypeManager.registerNodeTypes methods.

BR,

Jukka Zitting

--
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development
Mime
View raw message