The HTML code below generates a page containing buttons which call simple functions using the XMLSpy Browser Plug-in. You can use this code as a template to build more complex solutions using the control.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Minimal XMLSpyDocEditPlugIn page</title>
<SCRIPT ID=clientEventHandlers LANGUAGE=vbscript>
Sub BtnOnSave
objPlugIn.XMLDataSaveUrl = "http://plugin.xmlspy.com/SaveFile.xml"
objPlugIn.Save
End Sub
Sub BtnOnClick
objPlugIn.SchemaLoadObject.URL = "http://plugin.xmlspy.com/OrgChart.xml"
objPlugIn.XMLDataLoadObject.URL = "http://plugin.xmlspy.com/OrgChart.xml"
objPlugIn.DesignDataLoadObject.URL = "http://plugin.xmlspy.com/OrgChart.sps"
objPlugIn.StartEditing
End Sub
Sub OnClickFind
objPlugIn.FindDialog
End Sub
Sub OnClickReplace
objPlugIn.ReplaceDialog
End Sub
Sub BtnOnTestProp
If objPlugIn.IsRowInsertEnabled Then
msgbox "true"
Else
msgbox "false"
End If
End Sub
</SCRIPT>
</head>
<body>
<OBJECT id=objPlugIn
odeBase="http://plugin.xmlspy.com/XMLSpyPluginCabinet.cab#Version=2,0,0,0"
lassid=clsid:46987108-BA64-4fd1-A947-1BF7DA938FC0 width="600" height="500">
<PARAM NAME="LicServer" VALUE="http://plugin.xmlspy.com">
<PARAM NAME="LicFile" VALUE="/key.lic">
</OBJECT>
<p><input type="button" value="Start editing" name="B3" onclick="BtnOnClick"></p>
<p><input type="button" value="Find" name="B4" onclick="OnClickFind"></p>
<p><input type="button" value="Replace" name="B5" onclick="OnClickReplace"></p>
<p><input type="button" value="Save" name="B6" onclick="BtnOnSave"></p>
<p><input type="button" value="Test property" name="B7" onclick="BtnOnTestProp"></p>
</body>
</html>
Please note that the values for the various parameters and attributes of the OBJECT tag, must be replaced with valid data for this sample to work.
Previous
Top
Next