Home Forums General XMetaL Discussion How to Disallow Empty Elements? Reply To: How to Disallow Empty Elements?

Derek Read

Reply to: How to Disallow Empty Elements?

Sounds like your customization is quite extensive already.

It is possible that checking for an empty value in that event might fail. I'm not aware of that limitation but it is possible.

I can't think of any *new* features in 13 that would help in this specific case. There might be other features you could take advantage of though. There are many other events and there are over 1000 APIs.

Perhaps you might try implementing something in On_Before_Document_Validate. You could walk the document in there (similar to the logic in your On_Document_Open_Complete macro) and look for issues, then display messages to the user. I could imagine a UI that takes the user directly to an that has issues and shows them your existing xref dialog, but perhaps with a “please fix this” message. The same XFT could probably be duplicated and modified so it contains slightly different prompts.

If you have Visual Studio or the Windows Script Debugger installed you can launch a debugging session by adding the keyword “debugger” into your script. This will allow you to step through your code and use the features that debugger provides.

If you have XMetaL Developer this is quite a bit simpler as you can launch XMetaL Author Enterprise from within Visual Studio in this case in debug mode, put breakpoints in your scripts, and gain all the advantages of Visual Studio's debugging system that way (including in some cases step over, step out, etc). The Programmers Guide and Customization Guide are written assuming you have XMetaL Developer (they ship with that software) but you can download CHM copies from our website if you don't have or don't want to use XMetaL Developer.