[ 
https://issues.apache.org/jira/browse/JCR-1195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540141
 ] 

Carsten Ziegeler commented on JCR-1195:
---------------------------------------

Ah, ok, thats a little bit unusual (compared to defining xml namespaces), but 
that's ok.

But I think the grammar in the docs needs an update then:
>>>
string ::= quoted_string | unquoted_string
quoted_string :: = "'" unquoted_string "'"
unquoted_string ::= [A-Za-z0-9:_]+
<<<

The characters for unquoted string do not contain the dash and from that 
definition there is no difference between string and unquoted string except the 
quotes around the string. So according to the grammar +a would be a valid 
prefix.



> CND: 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
>            Assignee: Jukka Zitting
>
> 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