I'm encoding a text in XML for an ehumanities project using Oxygen.
The file came pre-encoded with several tags, most of them were wrongly placed, so I had to tidy it up a lot. Most of it is done, but one major issue remains.
The page breaks <pb n="number"/> are wrong numbered. Strictly speaking their value is exactly one too little, which means <pb n="3"/> is supposed to be <pb n="4"/>.
There are over 300 of these page breaks.
Is there a way of incrementing every value with a Perl substitution?
I've managed to find every value with this regex pattern
<pb n="(\d+)"/>
and could replace it with:
<pb n="$1"/>
But how do I do a +1 operation on each value?
I'm not familiar with XPath and XSLT but am willing to learn it.
++operation.