And herein lies the rub…
The elements I have to work with are sibling elements with different names. I have an intro, a body, and an appendix element. These are all siblings, they all need to restart the counter and collect the total number of pages to the end of the element. They are currently all using the same page counter and pagespec. I’m not sure if this is my problem, but I don’t have much flexibility with the DTD, so I’m trying to make the best of what I have.
I tried eliminating all but the counter for the intro content, and scoping the tiv there, but when I add scope local to the intro element, I lose the value all together. I have the default for this tiv set to ‘count’ just to make sure I had the variable picking up in the footer, and I get that if I do NOT have scope set for the tiv. When I set the scope local to the intro element, I get no value at all.
The page counter itself is set to Arabic, init to 0. It enumerates in the folio for both recto and verso pages, and after that I have a savetext sending the page counter value to a variable, set to occur after, no append. This value gets used for the TOC that generates for the body element, and it seems to work just fine.
When I have the tiv set for all three (subchar with a savetext that occurs after, sending the value of the variable set in the folio from the page counter [BO] to the tiv), the intro shows “Page 1 of count”, which is the default value for the tiv, the body will count “Page 1 of 1” and so on but subsequent pages will say “Page 2 of 1” and so forth. The appendix just carries the “1” from the body element.
Also, the intro, body, and appendix elements start a new page, with the page id being the same for all, and the page start being “next” and the scope is local. The footer that appears in this pageset id is a pseudoelement (needed to adjust font formatting on different lines of the footer). I also tried breaking out the one line from the pseudoelement footer and placing directly in the footer, but this didn’t seem to make a difference.
I can’t say that I’ve tried to reset and use the same tiv more than once in the same document instance, so I don’t know if it’s possible? Seems like it should be, but if I’m off-track, please say so. If I need to split out to separate tivs (or even reference as separate page sets) that’s fine. Just trying to find if there are other ideas before I put that much more work forward.