You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by David Moss <da...@infoflow.co.uk> on 2006/11/10 17:35:19 UTC

Unable to define node type without child nodes in CND

Am I correct in thinking that it's not possible to define a node type that
only contains properties (i.e. no child nodes) in CND?
 
I've tried:
 
<namespace= 'http://www.mynamespace.co.uk/namespace'>
<nt = 'http://www.jcp.org/jcr/nt/1.0'>
[namespace:document] > nt:file
    - namespace:name (string) mandatory
 
but I get an error 'Missing '[' delimiter for beginning of node type name
...' when the parser comes to processing the next node in my list of
definitions.
 
however, if I do something like:
 
<namespace= 'http://www.mynamespace.co.uk/namespace'>
<nt = 'http://www.jcp.org/jcr/nt/1.0'>
[namespace:document] > nt:file
    - namespace:name (string) mandatory
   + namespace:arbitraryNode (namespace:arbNodeType)
 
it works.
 
Have I done something obviously wrong here, or is it actually not possible
to define a node type with no child nodes?
 
Thanks in advance
 


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

Re: Unable to define node type without child nodes in CND

Posted by Stefan Guggisberg <st...@gmail.com>.
hi david

On 11/10/06, David Moss <da...@infoflow.co.uk> wrote:
> Ah, think I've got it.
>
> I was under the impression (from reading other examples on the net) that the
> namespace declarations should be made for each node type, not just once at
> the top.
>
> Multiple namespace declarations work fine, except where a node does not
> contain a child node definition:
>
> <namespace= 'http://www.mynamespace.co.uk/namespace'>
> <nt = 'http://www.jcp.org/jcr/nt/1.0'>
> [namespace:document] > nt:file
>    - namespace:name (string) mandatory
>
> [namespace:document2] > nt:file
>    - namespace:name (string) mandatory
>
> Works fine, but
>
>
> <namespace= 'http://www.mynamespace.co.uk/namespace'>
> <nt = 'http://www.jcp.org/jcr/nt/1.0'>
> [namespace:document] > nt:file
>    - namespace:name (string) mandatory
>
> <namespace= 'http://www.mynamespace.co.uk/namespace'>
> <nt = 'http://www.jcp.org/jcr/nt/1.0'>
> [namespace:document2] > nt:file
>    - namespace:name (string) mandatory
>
>
> Does not.
>
> Is there a bug here?

the BNF in http://jackrabbit.apache.org/api-1/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.html
defines:

[...]
cnd ::= {ns_mapping | node_type_def}
[...]

hence it's either a bug in the BNF or in the cnd parser. feel free to
post a jira issue.

thanks
stefan

>
> D.
>
>
> -----Original Message-----
> From: tobias.strasser@gmail.com [mailto:tobias.strasser@gmail.com] On Behalf
> Of Tobias Bocanegra
> Sent: 10 November 2006 16:49
> To: users@jackrabbit.apache.org
> Subject: Re: Unable to define node type without child nodes in CND
>
> hi david,
> i quickly tried the following example:
>
> <namespace= 'http://www.mynamespace.co.uk/namespace'>
> <nt = 'http://www.jcp.org/jcr/nt/1.0'>
> [namespace:document] > nt:file
>    - namespace:name (string) mandatory
>
> [namespace:document2] > nt:file
>    - namespace:name (string) mandatory
>
> which worked for me.
> maybe you can provide your entire cnd?
>
> regards, toby
>
>
> On 11/10/06, David Moss <da...@infoflow.co.uk> wrote:
> > Am I correct in thinking that it's not possible to define a node type
> > that only contains properties (i.e. no child nodes) in CND?
> >
> > I've tried:
> >
> > <namespace= 'http://www.mynamespace.co.uk/namespace'>
> > <nt = 'http://www.jcp.org/jcr/nt/1.0'> [namespace:document] > nt:file
> >     - namespace:name (string) mandatory
> >
> > but I get an error 'Missing '[' delimiter for beginning of node type
> > name ...' when the parser comes to processing the next node in my list
> > of definitions.
> >
> > however, if I do something like:
> >
> > <namespace= 'http://www.mynamespace.co.uk/namespace'>
> > <nt = 'http://www.jcp.org/jcr/nt/1.0'> [namespace:document] > nt:file
> >     - namespace:name (string) mandatory
> >    + namespace:arbitraryNode (namespace:arbNodeType)
> >
> > it works.
> >
> > Have I done something obviously wrong here, or is it actually not
> > possible to define a node type with no child nodes?
> >
> > Thanks in advance
> >
> >
> >
> > ______________________________________________________________________
> > This email has been scanned by the MessageLabs Email Security System.
> > For more information please visit http://www.messagelabs.com/email
> > ______________________________________________________________________
> >
>
>
> --
> -----------------------------------------< tobias.bocanegra@day.com >---
> Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel T
> +41 61 226 98 98, F +41 61 226 98 97
> -----------------------------------------------< http://www.day.com >---
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>

RE: Unable to define node type without child nodes in CND

Posted by David Moss <da...@infoflow.co.uk>.
Ah, think I've got it.

I was under the impression (from reading other examples on the net) that the
namespace declarations should be made for each node type, not just once at
the top.

Multiple namespace declarations work fine, except where a node does not
contain a child node definition:

<namespace= 'http://www.mynamespace.co.uk/namespace'>
<nt = 'http://www.jcp.org/jcr/nt/1.0'>
[namespace:document] > nt:file
   - namespace:name (string) mandatory

[namespace:document2] > nt:file
   - namespace:name (string) mandatory

Works fine, but


<namespace= 'http://www.mynamespace.co.uk/namespace'>
<nt = 'http://www.jcp.org/jcr/nt/1.0'>
[namespace:document] > nt:file
   - namespace:name (string) mandatory

<namespace= 'http://www.mynamespace.co.uk/namespace'>
<nt = 'http://www.jcp.org/jcr/nt/1.0'>
[namespace:document2] > nt:file
   - namespace:name (string) mandatory


Does not.

Is there a bug here?

D.


-----Original Message-----
From: tobias.strasser@gmail.com [mailto:tobias.strasser@gmail.com] On Behalf
Of Tobias Bocanegra
Sent: 10 November 2006 16:49
To: users@jackrabbit.apache.org
Subject: Re: Unable to define node type without child nodes in CND

hi david,
i quickly tried the following example:

<namespace= 'http://www.mynamespace.co.uk/namespace'>
<nt = 'http://www.jcp.org/jcr/nt/1.0'>
[namespace:document] > nt:file
   - namespace:name (string) mandatory

[namespace:document2] > nt:file
   - namespace:name (string) mandatory

which worked for me.
maybe you can provide your entire cnd?

regards, toby


On 11/10/06, David Moss <da...@infoflow.co.uk> wrote:
> Am I correct in thinking that it's not possible to define a node type 
> that only contains properties (i.e. no child nodes) in CND?
>
> I've tried:
>
> <namespace= 'http://www.mynamespace.co.uk/namespace'>
> <nt = 'http://www.jcp.org/jcr/nt/1.0'> [namespace:document] > nt:file
>     - namespace:name (string) mandatory
>
> but I get an error 'Missing '[' delimiter for beginning of node type 
> name ...' when the parser comes to processing the next node in my list 
> of definitions.
>
> however, if I do something like:
>
> <namespace= 'http://www.mynamespace.co.uk/namespace'>
> <nt = 'http://www.jcp.org/jcr/nt/1.0'> [namespace:document] > nt:file
>     - namespace:name (string) mandatory
>    + namespace:arbitraryNode (namespace:arbNodeType)
>
> it works.
>
> Have I done something obviously wrong here, or is it actually not 
> possible to define a node type with no child nodes?
>
> Thanks in advance
>
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email 
> ______________________________________________________________________
>


--
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel T
+41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

Re: Unable to define node type without child nodes in CND

Posted by Tobias Bocanegra <to...@day.com>.
hi david,
i quickly tried the following example:

<namespace= 'http://www.mynamespace.co.uk/namespace'>
<nt = 'http://www.jcp.org/jcr/nt/1.0'>
[namespace:document] > nt:file
   - namespace:name (string) mandatory

[namespace:document2] > nt:file
   - namespace:name (string) mandatory

which worked for me.
maybe you can provide your entire cnd?

regards, toby


On 11/10/06, David Moss <da...@infoflow.co.uk> wrote:
> Am I correct in thinking that it's not possible to define a node type that
> only contains properties (i.e. no child nodes) in CND?
>
> I've tried:
>
> <namespace= 'http://www.mynamespace.co.uk/namespace'>
> <nt = 'http://www.jcp.org/jcr/nt/1.0'>
> [namespace:document] > nt:file
>     - namespace:name (string) mandatory
>
> but I get an error 'Missing '[' delimiter for beginning of node type name
> ...' when the parser comes to processing the next node in my list of
> definitions.
>
> however, if I do something like:
>
> <namespace= 'http://www.mynamespace.co.uk/namespace'>
> <nt = 'http://www.jcp.org/jcr/nt/1.0'>
> [namespace:document] > nt:file
>     - namespace:name (string) mandatory
>    + namespace:arbitraryNode (namespace:arbNodeType)
>
> it works.
>
> Have I done something obviously wrong here, or is it actually not possible
> to define a node type with no child nodes?
>
> Thanks in advance
>
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: Unable to define node type without child nodes in CND

Posted by Stefan Guggisberg <st...@gmail.com>.
hi david,

On 11/10/06, David Moss <da...@infoflow.co.uk> wrote:
> Am I correct in thinking that it's not possible to define a node type that
> only contains properties (i.e. no child nodes) in CND?
>
> I've tried:
>
> <namespace= 'http://www.mynamespace.co.uk/namespace'>
> <nt = 'http://www.jcp.org/jcr/nt/1.0'>
> [namespace:document] > nt:file
>     - namespace:name (string) mandatory
>
> but I get an error 'Missing '[' delimiter for beginning of node type name
> ...' when the parser comes to processing the next node in my list of
> definitions.
>
> however, if I do something like:
>
> <namespace= 'http://www.mynamespace.co.uk/namespace'>
> <nt = 'http://www.jcp.org/jcr/nt/1.0'>
> [namespace:document] > nt:file
>     - namespace:name (string) mandatory
>    + namespace:arbitraryNode (namespace:arbNodeType)
>
> it works.
>
> Have I done something obviously wrong here, or is it actually not possible
> to define a node type with no child nodes?

it definitely should be possible so this might well be a bug in the cnd parser.
please create a jira issue with a small example cnd file that demonstrates
the issue.

thanks
stefan

>
> Thanks in advance
>
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>