Subject: bug#7096: 23.1; nxml-mode attribute validation with rnc

From: Stefan Majewski <[email-masked]>
Date: Fri, 24 Sep 2010 17:10:27 +0200

Dear Emacs devs, @CC James Clark as initial developer of nxml-mode,

first of all thanks for emacs and especially thanks for nxml-mode, as I
couldn't do or wouldn't like to do without it.

I frequently encounter the following bug with nxml-mode:

Whenever I try to use specific attribute definitions that are well
covered within the specs of RelaxNG Compact syntax, Emacs does not
validate some RNC schemas correctly. Jing (after a convertion with
trang) and other relaxng tools, nevertheless do. I tried to debug it
myself, but can't see where it goes wrong, as everything indeed seems to
be correctly in place.

The bug certainly relates to the way attribute restrictions can be based
on Unicode Character Classes like \p{P} for punctuation or \p{L} for
letter. For some strange reason the definitions for Letter seem to work
while Punctuation is not handled correctly.

Consider this minimal example (RNC and corresponding XML):

## BEGIN RNC
test = element test {
     empty,
     attribute att {
               xsd:token { pattern = "(\p{L}|\p{P})+" }
     }
}

start = test
##END RNC

<!-- BEGIN XML -->
<test att="att_val"/>
<!-- END XML -->

Strange enough, it validates when the underscore ("_" (unicode 95,
included in \p{Pc} and thus \p{P}) is removed from the XML.

But it is not just the underscore, other punctuation characters fail as
well. I could not find an obvious error in nxml's definition of the
character classes in xsd-regexp.el

As this behaviour is against the specs, I would consider it a bug in
nxml-mode.

If there is anything more I could help to track this bug down, please
let me know.

cheers,
Stefan

-- 
| Stefan Majewski  | Department of English, University of Vienna     |
| VOICE Corpus     | Spitalgasse 2-4, Universitätscampus AAKH, Hof 8 |
|                  | A-1090 Vienna                                   |
| Research Ass.(IT)| Phone: +43 1 4277 424 46                        |