I want to group together footnote by fnrtoken in order of fnlabel. all the with fnrtoken should be grouped together order by label . but if any footnote without fnlabel is between those footnote then new group should be created for that footnote and again start new group for remaiing footnote with fnlable
Input:
<endnotes>
<footnote fntoken="aasdf" fnrtoken="78hyyj">
<fnlabel>2</fnlabel>
<para></para>
</footnote>
<footnote fntoken="aasdf" fnrtoken="78jjjj">
<fnlabel>1</fnlabel>
<para></para>
</footnote>
<footnote fntoken="aasdf" fnrtoken="7900hj">
<fnlabel>4</fnlabel>
<para></para>
</footnote>
<footnote fntoken="aasdf">
<fnlabel>3</fnlabel>
<para></para>
</footnote>
<footnote fntoken="aasdf">
<fnlabel>5</fnlabel>
<para></para>
</footnote>
</endnotes>
Output:
<footenotegrp>
<footnote fntoken="aasdf" fnrtoken="78jjjj">
<fnlabel>1</fnlabel>
<para></para>
</footnote>
<footnote fntoken="aasdf" fnrtoken="78hyyj">
<fnlabel>2</fnlabel>
<para></para>
</footnote>
</footenotegrp>
<footenotegrp>
<footnote fntoken="aasdf">
<fnlabel>3</fnlabel>
<para></para>
</footnote>
</footenotegrp>
<footenotegrp>
<footnote fntoken="aasdf" fnrtoken="7900hj">
<fnlabel>4</fnlabel>
<para></para>
</footnote>
</footenotegrp>
<footenotegrp>
<footnote fntoken="aasdf">
<fnlabel>5</fnlabel>
<para></para>
</footnote>
</footenotegrp>