Subject: Re: bug#8516: nxml-mode: pattern matching should be case-sensitive in validation

From: Yuanle Song <[email-masked]>
Date: Mon, 18 Apr 2011 05:00:16 -0500

I think it's because string-match ignore case when case-fold-search is t
(which is the default), so greped a little on nxml dir and found the
following function may be the problem. But I haven't read the how the
whole file and don't know how nxml validation works, so some one more
knowledgeable should verify this is the right thing to do.

I tested on the test.xml and test.rnc and after this patch, capitalized
"Test" will result an invalid xml file.

Thanks,
Yuanle

--- /home/sylecn/fromsource/emacs-23.3/lisp/nxml/rng-xsd.el	2011-01-08 11:45:14.000000000 -0600
+++ /home/sylecn/fromsource/emacs/lisp/nxml/rng-xsd.el	2011-04-18 04:35:08.135816534 -0500
@@ -238,7 +238,7 @@
 	 obj)))
 
 (defun rng-xsd-check-pattern (str regexp convert &rest args)
-  (and (string-match regexp str)
+  (and  (let (case-fold-search) (string-match regexp str))
        (apply convert (cons str args))))