aerdev
aerdev

Reputation: 1

Using .NET objects in XMLSpy Script Editor

I'm trying to import a Guid object into my XMLSpy script editor, as described in the manual CLR.Create. This is necessary in order to use the generated guid in an xml document, but before that it must be converted to a string. There is a code

var objGuid = CLR.Create("System.Guid");
var guid = objGuid.NewGuid();
confirm(guid);

that generates a guid and can display it in a conform-form, but when I try to insert an "guid" with the "ReplaceText" command tv.ReplaceText(416, 452, guid); a type mismatch error appears tmError At the same time: an attempt to convert the variable "guid" to a string (guid.toString or guid.ToString()) ends with the error "guid.toString is null or is not an object". Type of "guid" is unknown nullError The "objGuid" object is converted to a string, but such a guid consists entirely of zeros. Type of "objGuid" is object zeroGuid

Is there any way that will allow me to convert this object to a string correctly?

Thanks!

I tried using a different method CLR.Static, but the result is the same.

Upvotes: 0

Views: 25

Answers (0)

Related Questions