Dash not allowed for prefix in node type definitions
----------------------------------------------------

                 Key: JCR-1195
                 URL: https://issues.apache.org/jira/browse/JCR-1195
             Project: Jackrabbit
          Issue Type: Bug
          Components: nodetype
    Affects Versions: 1.3.1, 1.4
            Reporter: Carsten Ziegeler


If you try to use a dash for a prefix inside a note type definition (cnd text 
file), this currently leads to an exception during reading the file by the node 
type definition reader.
For example adding <prefix-test = "http://some.url";> to the definition fails 
with:

org.apache.jackrabbit.core.nodetype.compact.ParseException: Missing = in 
namespace decl. (cnd-reader-test-input.cnd, line 18)
        at 
org.apache.jackrabbit.core.nodetype.compact.Lexer.fail(Lexer.java:148)
        at 
org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader.doNameSpace(CompactNodeTypeDefReader.java:228)
        at 
org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader.parse(CompactNodeTypeDefReader.java:197)
        at 
org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader.&amp;init&amp;(CompactNodeTypeDefReader.java:169)
        at 
org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader.&amp;init&amp;(CompactNodeTypeDefReader.java:154)
        at 
org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefTest.testCompactNodeTypeDef(CompactNodeTypeDefTest.java:108)
        at 
org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefTest.testCompactNodeTypeDef(CompactNodeTypeDefTest.java:108)


This patch for the core test cases shows the error:

Index: 
/Users/cziegeler/Developer/workspaces/default/jackrabbit/jackrabbit-core/src/test/resources/cnd-reader-test-input.cnd
===================================================================
--- 
/Users/cziegeler/Developer/workspaces/default/jackrabbit/jackrabbit-core/src/test/resources/cnd-reader-test-input.cnd
       (revision 587815)
+++ 
/Users/cziegeler/Developer/workspaces/default/jackrabbit/jackrabbit-core/src/test/resources/cnd-reader-test-input.cnd
       (working copy)
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 <ex = "http://example.org/jackrabbit/example";>
+<prefix-test = "http://some.url";>
 [ex:NodeType] > ex:ParentNodeType1, ex:ParentNodeType2
   orderable mixin
   - ex:property (long) = '1', '2' primary mandatory autocreated protected 
multiple version < '[1,10]'


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to