Hi Clay,
Ok! Using your coding I managed to implement it within Styler. It has to be divided though.
What I did was select the element graphic everywhere and I inserted a condition, chose type If, and clicked on the New Xpath Test... button. I entered:
(count(ancestor::figure/graphic)>1)
Then with the condition selected I chose the Category: Generated text and clicked on the Edit Button next to Add before element content: At this point it gets a bit funny to edit, because you cannot simply paste in text, there are additional steps;
Type "Sheet " then from the Insert menu choose Xpath String... at that point when the dialog box comes up you can insert the xpath string in the XPath Expression: field
count(preceding-sibling::graphic)+1
I then clicked on ok, typed " of " and repeated the process for the following:
count(ancestor::figure/graphic)
It looks like this:
[cid:image002.png@01CFDEFE.5F1FC210]
Note - I found I can edit the xpath string by selecting it and choosing modify attributes from the right click context menu
After editing this is complete, choose from the File menu Apply and Close. The expression then looks like this:
[cid:image003.png@01CFDEFE.5F1FC210]
I copied the code from the field so you can see it:
Sheet*<_gte:XPathString expr="count(preceding-sibling::graphic)+1"/>*of*<_gte:XPathString expr="count(ancestor::figure/graphic)"/>
And, it works! Woot!
Many thanks for your help Clay!
Greg
🙂