Skip to content

Emacs package 0.2.0

Choose a tag to compare

@nivaca nivaca released this 17 Nov 23:54

Two additions to the Emacs package. py-xmlvalidate.py is unchanged (1.16).

Flycheck. The package now registers a Flycheck checker as well as the Flymake backend. With py-xmlvalidate-frontend at its default, auto, it uses Flycheck when it is installed and Flymake otherwise. With Flycheck, the problems appear in Flycheck's usual display (C-c ! l, the fringe, flycheck-posframe), with the layer at the start of each message and the Schematron pattern as the error's id. The package applies the trusted-content rule itself, since Flycheck has none.

The schema for nxml. nxml-mode cannot read <?xml-model?>, so it worked with an empty schema and its completion offered nothing. After each check whose schema is RelaxNG, the package now converts the schema to the compact syntax with trang, keeps it in a cache, and gives it to nxml: C-RET then completes the elements and attributes the schema allows, and nxml's own validation knows the schema. A schema you chose for nxml yourself is never replaced, and nothing is written next to your documents. nxml mishandles some Unicode punctuation (it would reject ed="#U2"), so in its copy of the schema TEI's word pattern also lists those characters.

trang needs Java. tools/install-trang.py, in the repository, downloads it from the jing-trang releases, checks its SHA-1 and installs it in ~/bin (or ~/.local/bin). Or set py-xmlvalidate-trang to another copy.

With Straight: M-x straight-pull-package RET py-xmlvalidate, then restart Emacs. M-x py-xmlvalidate-check-setup says which checker is used and whether trang is found.

File: py-xmlvalidate-emacs-v0.2.0.zip, the scripts, the Emacs package and the documentation.