General XMetaL Discussion
biswajitsr July 19, 2010 at 9:01 am
Need to replace the active documentJuly 19, 2010 at 9:01 amParticipants 0Replies 1Last Activity 12 years, 2 months ago
I need to send the active document content to server against some menu action and get the changed content for the same document. And replace the active document with the changed one from server. All these will be happened on single action from menu.
Here I am able to send the document through service call from C# connector code and get the document. But is it possible to update the full document automatically. I don't need to save that in the flow. Just showing the changed one is enough for me.Derek Read July 19, 2010 at 5:47 pm
Reply to: Need to replace the active documentJuly 19, 2010 at 5:47 pm
Based on previous posts I'm guessing you are working with XMAX. Best to do that in each posting so the post makes sense as a stand-alone conversation, unless you link to other postings. If that is not correct please let us know which product you are working with.
You have a few options I can think of:
1) Write your return string to the XMAX-specific Document.Xml property. See Programmer's Guide topic “XMetaL XMAX interfaces” > “Properties” > “Xml”.
2) Close the ActiveDocument and use LoadFromString() to open your return string.
3) Replace the content of the root node in the current document with a similar construction. In this case if your return string is an entire document, including XML prolog (XML declaration and DOCTYPE declaration, etc) then you would need to strip that off.
If you do not wish the user to be able to undo these actions then you can also call UndoClear().
- You must be logged in to reply to this topic.