Right, prince-script() functions cannot update the DOM. Or they can, but it's too late, and it won't affect the document typesetting which is already ongoing. What is it you want to do? There may be another way to do it.
Yup, there might be another way. I even think I saw it here in the forum weeks ago, but I cannot find it anymore.
My Problem: - front matter pages are displayed roman, from say I to IX - for the main matter the page counter is reset to 1 (say 1 to 99), - for the back matter I have to resume the front matter counter, starting with X in this example.