General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › How to traverse PIs?
achu June 2, 2011 at 1:32 am
How to traverse PIs?June 2, 2011 at 1:32 amParticipants 2Replies 3Last Activity 11 years, 9 months ago
I would like to traverse PIs which are generated by track changes. How to populate PIs collection? Thanks!Derek Read June 2, 2011 at 4:51 am
Reply to: How to traverse PIs?June 2, 2011 at 4:51 am
Use these APIs for working with Change Tracking:
I think that's all of them. See Programmer's Guide for details. These were really designed to allow you to provide custom UI for the end user if the two interfaces we provide (the toolbar and the dialog) don't do exactly what you need them to.
I don't think the getNodesByXPath() API can be used for Change Tracking because these PIs are a special part of the document's node tree and may not show up with that API.
If you need to make programmatic changes to these that could get very tricky. You could try walking the document using Range.GotoNext() and at each location check to see if you are in a PI node (nodetype = 7) and if so whether it has the correct target value.
Perhaps knowing what you need to do with these nodes will help me give a better answer.achu June 3, 2011 at 9:05 pm
Reply to: How to traverse PIs?June 3, 2011 at 9:05 pm
We have an external program to capture line number and page number from the printing version of xml for each change. I would like to integrate this additional information to the track change PI for the further process.Derek Read June 3, 2011 at 11:04 pm
Reply to: How to traverse PIs?June 3, 2011 at 11:04 pm
If you alter one of the Change Tracking PIs such as to include additional information that XMetaL Author itself does not insert, XMetaL may end up removing it or the Change Tracking feature (for that particular tracked change) may be broken.
If I understand you correctly, you might be hoping you can do the following?
"dread" time="20110603T155632-0800" data="<p>this is a test</p>"?>
Your Custom PI:
"dread" time="20110603T155632-0800" data="<p>this is a test</p>" page="5" line="100"?>
I'm not sure what you will be doing with this additional meta-data and whether your XMetaL customization scripts would need access to it (or maybe the user needs to see it for some reason) but perhaps you could encode this information as an additional set of PIs at the start or end of the document?
- You must be logged in to reply to this topic.