xml spy
Top  Next
Programmer's Reference


Basic concepts
The introduction of the COM based API makes the functionality of XMLSpy available to other applications. It is now possible to automate a wide range of tasks from simple file validations to complex XML content modifications using the XMLData interface. The API is also the main requirement for the built-in scripting environment of XMLSpy. See the chapter "Scripting" in this manual for further documentation.

XMLSpy and the XMLSpyAPI, follow the common specifications for automation servers from Microsoft. It is possible to access the methods and properties from most development environments such as C, C++, VisualBasic, Delphi and from scripting languages like VBScript and JavaScript.

To support scripting, concessions had to be made to make all parameters compatible to the VARIANT structure and allow special handling of JavaScript out-parameters (see "How to handle an event" for an example).

The following limitations have to be considered in your client code:


1.Don't hold references to objects in memory longer than you need them, especially those from the XMLData interface. If the user interacts between two calls of your client, then there is no guarantee that these references are still valid.  
 
2.Free references explicitly.  
 
3.Be aware that if your client code crashes instances of XMLSpy may still remain in the system.  
 
4.Don't forget to disable dialogs if the user interface is not visible.  
 
5.See "Error handling" to avoid annoying error messages.  
 
6.Terminate XMLSpy with the "Application.Quit" method.  



Top  Next

© 2002 Altova