RELAX NG, MODS, and Annotation
RELAX NG brings the power of xml schema to the masses. A few months ago I did not even know how to write a DTD. When I needed a way to code my course syllabi this year, I decided to bite the bullet and learn RELAX NG. It didn’t take me long to become comfortable with the compact syntax, and to understand not just how easy RELAX NG is, but how powerful.
So, I’ve converted MODS to RELAX NG. My next step – only made with a fair bit of help from contributors to the relaxng-users list – was to figure out how to merge it with my own schema for bibliographic annotations. Because MODS allows for foreign namespaces in its extension element, I wanted to create my own custom schema that I could plug in so I could use it to drive editing in the fantastic new nxml mode for emacs (available here).
Schema files available at:
http://www.users.muohio.edu/darcusb/files/mods-schema.tar.gz
Example instance at:
http://www.users.muohio.edu/darcusb/files/test.mods
For the notes I started with docbook-ish markup, but switched to the more compact element names of html (along with additional attributes) to keep markup less intrusive. I may change back; who knows.
If you create a file in nxml mode and load the mods-bn schema, you will get tag completion on the extension element for the notes schema. If nothing else, perhaps this shows the potential of RELAX NG. More importantly, it’ll help me get some work done over the long weekend (holiday here in the U.S.).
Comments welcome. I’ve not quite determined if the attribute-based approach to tag bibliographic references will work for these needs, or whether I need to switch to something like the new DocBook stuff that has just been tentatively approved.
Creative Commons License