General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › Issue with Accept/Reject Change Tracking Programmatically
-
mjkhan June 18, 2014 at 6:05 pm
Issue with Accept/Reject Change Tracking Programmatically
June 18, 2014 at 6:05 pmParticipants 3Replies 4Last Activity 8 years, 7 months agoHi,
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();
}
} //whileHere 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 7Any help would be very much appreciated.
Thanks
MahmoodDerek Read June 18, 2014 at 9:30 pm
Reply to: Issue with Accept/Reject Change Tracking Programmatically
June 18, 2014 at 9:30 pmI 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]
[/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]mjkhan June 27, 2014 at 7:26 pm
Reply to: Issue with Accept/Reject Change Tracking Programmatically
June 27, 2014 at 7:26 pmDerek,
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.
Can you put the following content in the
Thanks
MahmoodDerek Read June 27, 2014 at 9:42 pm
Reply to: Issue with Accept/Reject Change Tracking Programmatically
June 27, 2014 at 9:42 pmI do not see a crash when I run that test code against this most recent sample content.
-
AuthorPosts
- You must be logged in to reply to this topic.