The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.
Here's my structure (Styler 5.4):
<condtinsp>
<inspection>
<condition></condition>
<req></req>
</inspection><inspection>
<condition></condition>
<req></req>
</inspection><inspection>
<condition></condition>
<req></req>
</inspection><inspection>
<condition></condition>
</condtinsp>
I want to number the condition tags but only if they have content (they have no title so making them a Formal Block didn't help) with the XPATH count(../preceding::condition) + 1
I created a content test condition for the XPATH on <condition> in Styler so only the non-empty conditions are numbered, but the counter is incrementing on the empty conditions. So the first three numbered <condition>s are numbered 1, 9, 10 because there are 8 empty conditions following the first numbered one.
I don't know how to keep the empty <conditions> from incrementing the counter, or if that is even possible. Some kind of subtraction, maybe?
Thanks for any ideas!
Thank you everyone! Brandon's worked.
Although this morning I realized I could simply increment and output a counter in FOSI in the non-empty content condition I had set up for <condition> in Styler:
<enumerat increm="1" enumid="conditionct"/">
<usetext source="conditionct,\.\,@10pt" placemnt="before"></usetext>
I should have figured this out before posting but I do keep all the responses to my XPATH questions in a file which I refer back to constantly, so I appreciate everyone's help.
Whoops! <condition> has to reset when it hits<syshd>
<inspection>
<condition></condition>
<req></req>
</inspection>
<inspection>
<condition></condition>
<req></req>
</inspection>
<inspection>
<condition></condition>
<req></req>
</inspection>
<syshd></syshd>
<inspection>
<condition></condition>
<req></req>
</inspection>
<syshd></syshd>
<inspection>
<condition></condition>
<req></req>
</inspection>
Thanks to Brandon's response to another thread, I figured it out to be:
count(preceding::condition[node()]) - count(preceding::syshd[1]/preceding::condition[node()]) + 1