Jeff turned me on to jEdit, “a cross platform, programmer’s text editor written in Java” that, with the XML plugin, is a nifty way to tag XHTML or TEI-conformant XML. It enforces the DTD as you go, just like XMetal. Unlike XMetal, jEdit is free.
I’ll go into more detail about setting it up if anyone’s interested.
Update, June 23: Okay, first make sure you have the right Java runtime environment on your computer. Then, you download the appropriate version of jEdit from the website. Since I reluctantly run Windows, I downloaded the Java-based installer for that system, but you should be able to follow the directions on the website for any OS.
Once you have the program installed, you’ll want to add the XML plugin. To do so, make sure you’re online, then go to the jEdit “Plugins” menu, select “Plugin Manager,” and then click the “Install Plugins” button. You’ll be presented with a list of available plugins; just scroll down until you find the XML plugin, check the box, and click the “Install” button. Close the “Plugin Manager” screen. You will probably get a message telling you to restart jEdit in order for the new plugin to work.
In order to make the menus for tags, entities, and IDs visible on the right side of the screen, go to the “Utilities” menu and select “Global Options.” Select “Docking” from the menu on the left. Over on the right, scroll down till you see “XML Insert”; change the drop-down menu to read “right.” Close the “Global Options” window.
You should now see a box in the upper right-hand corner that reads, vertically, “XML Insert.” You can click on this box to make the tagging interface appear or disappear. Once the interface is visible, you can click on an element to get a pop-up window that provides you with a menu of appropriate attributes for that element. If you don’t want to see that window, however, you can just right-click the element and it will be inserted (both opening and closing tags) in the document wherever you have placed the cursor. If you have highlighted some text, then the opening tag will be placed before the text and the closing tag will be placed after it. If you type an opening tag, jEdit keeps track of that opening and will automaticallly insert an appropriate, complete closing tag when you begin to type it.
As I said above, the editor enforces the DTD as you go. The menu of elements will only display those elements that are allowed by the DTD at the point in your document where you have placed your cursor. I’ve played around with (X)HTML documents because it appears that the DTD is included with the XML plugin, but I haven’t tried downloading the TEI (or TEI-lite) and getting jEdit to enforce that DTD. I don’t see why it wouldn’t work just as well, however, and Jeff seems to be very happy with using it for this purpose.
There you have it. Any questions?