Home Forums General XMetaL Discussion Problems with toolbars Reply To: Problems with toolbars

Derek Read

Reply to: Problems with toolbars

The buttons are greyed out probably because the MCR file is not being loaded because it cannot be found. That either means the DTD is not being found (in which case the entire customization is not being loaded) or just the MCR file. There are many ways to resolve this, so it is difficult to say which you should opt for. However, the simplest is to have all customization files (DTD, CSS, CTM and MCR) in the same folder and make sure the DTD is being located.

Now might be a really good time to bite the bullet and update your XML files to use a more robust DOCTYPE declaration and get rid of the hard coded full paths. If your files include a PUBLIC id in addition to the SYSTEM id then you could use a catalog file and that would allow you to place your DTD anywhere you like.

Then all you need is the following entry in XMetaL's catalog file which is in the Rules subfolder:

PUBLIC "your own standardized public id" "C:somepathbioguide.dtd"

However, you can also opt to simply place your customization files (DTD, CSS, CTM and MCR) into the Rules subfolder instead and not make any catalog changes. In that case XMetaL will check the current folder (SYSTEM portion of the DOCTYPE declaration states it is in the same folder as the XML file: “bioguide.dtd”) it won't find it there (make sure you don't have a copy there) so that will fail, XMetaL then checks the catalog files, failing to find a PUBLIC id match the final fallback is to check for the DTD in the Rules subfolder.

All of that will future proof things in general (and also make your files more readily usable with other validating XML parsers in case you opt to use any in the future).

If you really don't want to change your files then manually recreate the following path on each machine and put your DTD, MCR and other customization files in there:
c:program filesblast radiusxmetal 4.6authorrulesbioguide.dtd

Another option would be to put your customization elsewhere but use the event macro On_Application_Resolve_Entity in an application-level macro file to swap the SYSTEM id value in the XML file with another one (in memory). I think that would be overkill for this situation though.

Yet another solution would be to create a macro that changes each file (using FSO and JScript string manipulation or another XML parser such as MSXML) just before it is opened if it meets certain criteria (namely that it is a file with that DOCTYPE that you want to alter). The event that would let you do that is On_Application_Before_Document_Open. Again, that seems like overkill to me. A far better solution (provided all your files are on disk somewhere) would be to process them all at once (after backing up of course) using a batch process with a text editor (to keep things simple) that has a powerful enough find and replace utility, such as Notepad++ or similar. Such a find and replace would probably take only a couple of minutes with Notepad++ if all your files are located near each other on the same drive.

Finally, make sure your MCR file is named bioguide.mcr (unless it is an application-level macro file in which case the name does not matter provided it has an MCR extension).

A few years ago I gave a webinar called “Deploying schemas and XMetaL Customization Files” on the topic of how XMetaL locates a DTD/XSD and associated customization files (this information is documented but there are so many possibilities and the information is somewhat fragmented across the Customization Guide, the Programmers Guide and XMetaL Author's help). The webinar failed to record properly so is unavailable (no big loss) but the slides are available here:
http://www.slideshare.net/XMetaL/deploying-schemas-and-xmetal-customization-files

See slide 8 for a diagram that should make your options pretty clear (the rest of that document will also be very useful to you).

Reply

Products
Downloads
Support