From: Lawrence Mitchell <wence@gmx.li>
To: 8516@debbugs.gnu.org
Cc: 288147-forwarded@bugs.debian.org
Subject: bug#8516: nxml-mode: pattern matching should be case-sensitive in validation
Date: Mon, 18 Apr 2011 11:52:42 +0100 [thread overview]
Message-ID: <m3d3kjzv9h.fsf@e4300lm.epcc.ed.ac.uk> (raw)
In-Reply-To: <87ipucoftf.fsf@raven.defaultvalue.org> (Rob Browning's message of "Sun, 17 Apr 2011 14:09:32 -0500")
Rob Browning wrote:
> (If possible, please preserve the 288147-forwarded address in any replies.)
> Vincent Lefevre <vincent@vinc17.org> writes:
>> Consider the following example:
>> ay:~> cat test.xml
>> <?xml version="1.0"?>
>> <root>Test</root>
>> ay:~> cat test.rnc
>> default namespace = ""
>> start = element root { xsd:normalizedString { pattern = "[a-z]*" } }
>> When test.xml is opened in emacs, nxml-mode says that the file is valid,
>> though the root element contains a "T". If I add ASCII letters (either
>> lowercase or uppercase), it still says that the file is valid, but as
>> soon as I add a non-letter character, nxml-mode says that the file is
>> invalid, as expected.
>> As a comparison, here's what I get with xmllint:
>> ay:~> trang test.rnc test.rng
>> ay:~> xmllint --noout --relaxng test.rng test.xml
>> test.xml:2: element root: Relax-NG validity error : Error validating
>> datatype normalizedString
>> test.xml:2: element root: Relax-NG validity error : Element root
>> failed to validate content
>> test.xml fails to validate
> Please see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=288147 for
> further information.
The various string-checking functions in rng-xsd.el probably need
to wrap string-match calls in a (let ((case-fold-search nil))
...)
To fix this particular problem, replace rng-xsd-check-pattern by:
(defun rng-xsd-check-pattern (str regexp convert &rest args)
(let ((case-fold-search nil))
(and (string-match regexp str)
(apply convert (cons str args)))))
Lawrence
--
Lawrence Mitchell <wence@gmx.li>
prev parent reply other threads:[~2011-04-18 10:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-17 19:09 bug#8516: nxml-mode: pattern matching should be case-sensitive in validation Rob Browning
2011-04-18 10:00 ` Yuanle Song
2011-05-22 19:47 ` Chong Yidong
2011-04-18 10:52 ` Lawrence Mitchell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3d3kjzv9h.fsf@e4300lm.epcc.ed.ac.uk \
--to=wence@gmx.li \
--cc=288147-forwarded@bugs.debian.org \
--cc=8516@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.