Pages: 1
Print
Author Topic: Need to replace the active document  (Read 1924 times)
biswajitsr
Member

Posts: 44


« on: July 19, 2010, 03:01:03 AM »

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.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2507



WWW
« Reply #1 on: July 19, 2010, 11:47:43 AM »

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().
Logged
Pages: 1
Print
Jump to: