Jackrabbit Content Repository
  1. Jackrabbit Content Repository
  2. JCR-637

Multiple namespace definitions in CND prevent definition of node type without child nodes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.1
    • Component/s: nodetype
    • Labels:
      None

      Description

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

      [...]
      cnd ::=

      {ns_mapping | node_type_def}

      [...]

      so multiple namespace definitions should not affect the node type definitions.

      However, the following CND definition will fail:

      <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

      Remove the second set of namespace definitions, and all's well:

      <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

        Activity

        Hide
        Stefan Guggisberg added a comment -

        applied patch (svn r475669):

        • adapted EBNF and parser: all ns declarations must precede first node type definiton
        Show
        Stefan Guggisberg added a comment - applied patch (svn r475669): adapted EBNF and parser: all ns declarations must precede first node type definiton
        Hide
        Stefan Guggisberg added a comment -

        attached patch for suggested change

        Show
        Stefan Guggisberg added a comment - attached patch for suggested change
        Hide
        Jukka Zitting added a comment -

        > probably the easiest fix would be to change the BNF (and the parser) so that namespace
        > declarations can only occur at the top of a .cnd file.

        +1

        Show
        Jukka Zitting added a comment - > probably the easiest fix would be to change the BNF (and the parser) so that namespace > declarations can only occur at the top of a .cnd file. +1
        Hide
        Stefan Guggisberg added a comment -

        the problem only occurs if a namespace declaration follows a property definition without value constraint(s), e.g.

        [...]

        • foo:prop (string) mandatory

        <bar='http://www.acme.org/bar'>
        [...]

        the '<' token in this example is ambiguos since it denotes both a list value constraints and a namespace declaration.

        the problem therefore are not intermixed namespace declarations and node type defintions per se. the problem is the
        ambiguity of the '<' token.

        probably the easiest fix would be to change the BNF (and the parser) so that namespace declarations can only occur at the top of a .cnd file.

        Show
        Stefan Guggisberg added a comment - the problem only occurs if a namespace declaration follows a property definition without value constraint(s), e.g. [...] foo:prop (string) mandatory <bar='http://www.acme.org/bar'> [...] the '<' token in this example is ambiguos since it denotes both a list value constraints and a namespace declaration. the problem therefore are not intermixed namespace declarations and node type defintions per se. the problem is the ambiguity of the '<' token. probably the easiest fix would be to change the BNF (and the parser) so that namespace declarations can only occur at the top of a .cnd file.

          People

          • Assignee:
            Stefan Guggisberg
            Reporter:
            David Moss
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development