1

I have 100 HTML files with a structure like this:

<div id="message-1">14 April 2015</div>
<div id="message-2">16 April 2015</div>
<div id="message-3">1 June 2015</div>
<div id="message-4">5 June 2015</div>
<div id="message-5">12 November 2015</div>
<div id="message-6">14 November 2015</div>
<div id="message-7">18 November 2015</div>

I use this xpath to create TOC level 1:

//h:div[starts-with(@id, "message-")]

With this xpath I have an entry for every day in the TOC:

14 April 2015
16 April 2015
1 June 2015
5 June 2015
12 November 2015
14 November 2015
18 November 2015

Is it possible to generate first occurrences of each month as Level 1? like this:

April 2015
June 2015
November 2015

or should I modify the original document itself?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.