Home › Forums › General XMetaL Discussion › get processing instruction node after xml declaration tag › Reply To: get processing instruction node after xml declaration tag
Reply to: get processing instruction node after xml declaration tagApril 5, 2012 at 12:58 am
You cannot modify nodes outside the root element while in Tags On or Normal view, they just are not accessible.
You have a few options I can think of:
1) Use the event On_Application_Before_Document_Open and 3rd party software to modify the file before it is opened.
2) In On_Document_Open_Complete switch to Plain Text view before making the modification. Note that in that view you do not have access to a DOM (it doesn't exist) so your options for interacting with the document are basically limited to manipulating text (as a use might) though you can use Selection and Find.Execute or you could load the whole file into a string and use JScript regular expression to do the replacement.
It looks like you are working with Documentum. If that is the case I would be wary of messing with files at this level as “XMetaL Author Enterprise for Documentum Webtop” (our integration with Documentum) may not like it if you mess with documents at this level.