XML processing error with MMApp.ActiveDocument.CentralTopic.Xml

Bryce K. shared this question 29 days ago
Answered

I am developing an addin for internal company use with MindManager and am trying to set the central topic's xml within the addin. When I do that, I get the error "0xc00cee65, Unspecified Error". I have tried changing several aspects of the xml that is input with no change to the error code. Can anyone help me determine what the problem with the xml is?

Comments (1)

photo
2

Hello Bryce. The central topic's XML will include the XML of the whole map. Are you modifying and replacing it, or generating XML externally? I have never tried replacing the XML for the entire document, and had very limited success with replacing the XML for a topic as it seemed to induce an instability that surfaced later. Generating or modifying a map by using API methods and properties will be more predictable than overwriting the XML.

photo
1

Thanks Nick. We have an odd use case where content is generated inside MindManager, then exported to a JSON version stored elsewhere. I am converting the JSON back to XML to try and load into MindManager. I am able to load it directly if I copy the XML string into a .xml file and open that file with MM, but the same XML or even something as simple as:

MMApp.ActiveDocument.CentralTopic.Xml = "<ap:Topic><ap:Text PlainText=\"654321 - Test model\"><ap:Font/></ap:Text></ap:Topic>"

gives me the same error. Do you have suggestions on how to use API methods to do load something externally generated?

photo
2

As far as I know, the only way to pass XML in the API is to write to the XML property of a document, topic or other document object. However I don't know what processing is applied by the Set method of the XML property, If opening an external XML file works, then could you use the API to do that instead? Not elegant, but save the string received from JSON conversion as a file, open it using the API and overwrite the current document.

photo
1

I think that's the route we're going to take - create a file in the temp directory, save it there, and then use the api to open. Thanks for you're brainstorming help.

photo
Leave a Comment
 
Attach a file