RELAX NG grammar for HTTPS Everywhere rulesets
Attached is a RELAX NG grammar for HTTPS Everywhere rulesets, in RELAX NG compact syntax (see http://www.relaxng.org/). I wrote it based on the documentation at https://www.eff.org/https-everywhere/rulesets and by looking at the existing rules (the rulesets web page isn't entirely up-to-date with respect to the syntax). You may find it useful for editing ruleset files in a RELAX NG-aware editor like Emacs' nxml-mode, and for validating rulesets with a tool like jing (https://code.google.com/p/jing-trang/).
I tried to use my grammar to validate all the rulesets in the git repository using jing, this gave me a few errors which I suspect are faults in those ruleset files rather than in my grammar:
$ find -name *.xml -print0 | xargs -0 jing -c https-everywhere.rnc
pending-rules/IsoHunt.xml:5:76: error: value of attribute "to" is invalid; must be a string matching the regular expression "https://." pending-rules/Three.xml:7:90: error: value of attribute "to" is invalid; must be a string matching the regular expression "https://."