unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* rnc validation in nxml mode
@ 2015-08-17 14:58 patrick mc allister
  0 siblings, 0 replies; only message in thread
From: patrick mc allister @ 2015-08-17 14:58 UTC (permalink / raw)
  To: help-gnu-emacs

hello,

i've run into a problem with nxml when it's supposed to validate an
attribute subtype="a-b" against this definition:

data.word = token { pattern = "(\p{L}|\p{N}|\p{P}|\p{S})+" }

(for context: http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-data.word.html)

nxml says "Attribute value invalid" because of the `-', but i think it
shouldn't: jing does not complain about this. changing to
subtype="edition+type" works.

does anyone have a suggestion how to work around this (preferably
other than hacking the schema)?

to reproduce quickly with a large-ish file:

(defun hacks/nxml-problem ()
  (let ((tmpBuffer (get-buffer-create "* a tmp buffer *"))
	(tmpSchema (make-temp-file "tei_schema" nil ".rnc")))
    (message "Getting sample xml file ...")
    (with-current-buffer tmpBuffer
      (erase-buffer)
      (url-insert-file-contents "https://github.com/sarit/SARIT-corpus/raw/059961c3df606ecfd41159e8b62a7e3517b6e9e8/pramanavarttikalankarabhasya.xml"))
    (message "Getting schema file ...")
    (with-temp-file tmpSchema
      (url-insert-file-contents "https://raw.githubusercontent.com/sarit/SARIT-corpus/059961c3df606ecfd41159e8b62a7e3517b6e9e8/schemas/tei_all.rnc"))
    (switch-to-buffer tmpBuffer)
    (nxml-mode)
    (rng-set-schema-file-and-validate tmpSchema)))

(hacks/nxml-problem)

-- 
patrick



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-17 14:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-17 14:58 rnc validation in nxml mode patrick mc allister

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).