General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Issue with Accept/Reject Change Tracking Programmatically

  • mjkhan

    Issue with Accept/Reject Change Tracking Programmatically

    Participants 3
    Replies 4
    Last Activity 8 years, 3 months ago

    Hi,
    I am using following code to loop over the list of track changes in XML document. The code crashes XMetaL when reading track changes which has images in it. For all other textual changes it works fine and has no problem.

      while (i++ < supplCount.length) {
            ActiveDocument.GotoNextChange();
            var strChange = Selection.TextWithRM;
            //ActiveDocument.Host.Alert(strChange);
            if (strChange.indexOf(“author=”No Change””) > 0 && ActiveDocument.CanAcceptOrRejectChange()) {
                ActiveDocument.RejectChange();
            }
        } //while

    Here is the XML snippet on which the XMetal hangs and crashes.

    We are using:
    XMetaL Author Enterprise 8 SP1
    XMetaL Author Enterprise for Documentum Version#: 4.0.0.018
    XMetaL Developer 7

    Any help would be very much appreciated.

    Thanks
    Mahmood

    Reply

    Derek Read

    Reply to: Issue with Accept/Reject Change Tracking Programmatically

    I can't reproduce this issue in either 8.0.1.051 (your version) or 9.0.0.047 (current release), presumably because my test is not the same as your's because I don't have all your code.

    I'm not sure how you are setting up or checking the value for supplCount.length in your while loop, so instead of doing that I'm repeatedly running the code within it, manually, over and over.

    I've created the following test document based on your snippet that includes change tracking that matches your indexOf() match as well as exact copies of your snippet that do not match. The ones that match are rejected (restored to the document), the ones that don't match are left alone. No crash. Perhaps try my test to see if you can reproduce. If not then the issue is probably triggered by the code I don't have.

    [code=test DITA topic]




     <?xm-replace_text Topic Title?>
     
     

    [/code]

    [code=test code]
    //XMetaL Script Language JScript:
    ActiveDocument.GotoNextChange();
    var strChange = Selection.TextWithRM;
    //ActiveDocument.Host.Alert(strChange);
    if (strChange.indexOf(“author=”No Change””) > 0 && ActiveDocument.CanAcceptOrRejectChange()) {
       ActiveDocument.RejectChange();
    }
    [/code]

    Reply

    mjkhan

    Reply to: Issue with Accept/Reject Change Tracking Programmatically

    Derek,
    Can you put the following content in the of the topic and try to see if the crash happens. Sometimes the cursor stops responding and when you add another element in the content is when the crash occurs. supplCount is the number of track changes within the document. So in example below you can set it 4.


                   
     
     
     
                   
     
     

    Thanks
    Mahmood

    Reply

    Derek Read

    Reply to: Issue with Accept/Reject Change Tracking Programmatically

    I do not see a crash when I run that test code against this most recent sample content.

    Reply

    mjkhan

    Reply to: Issue with Accept/Reject Change Tracking Programmatically

    The crash does not occur for Generic Topic. It is happening for customized Topic we have in our environment. I will open a support case to discuss it further.

    Thanks!

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support