Ich habe ein Problem mit meiner Transformation und hoffte auf ein paar Ideen. Ich habe es mit einem wirklich flachen Eingabedokument zu tun, bei dem alle wichtigen Knoten Geschwister voneinander sind.
Das sieht in etwa so aus:
<title1> Rule 51 </title1>
<p> text here </p>
<p> text here </p>
<note> Source </note>
<p> text here </p>
<title1> Rule 52 </title1>
<p> text here </p>
<p> text here </p>
<note> Source </note>
<p> text here </p>
Mein Ziel ist es, dass diese Eingabe wie folgt aussieht:
<section>
<title1> Rule 51 </title1>
<p> text here </p>
<p> text here </p>
<note> Source </note>
<p> text here </p>
</section>
<section>
<title1> Rule 52 </title1>
<p> text here </p>
<p> text here </p>
<p> text here </p>
<p> text here </p>
<note> Source </note>
<p> text here </p>
</section>
Wie Sie oben sehen können, ist mein Hauptziel Gruppierung jeder title1 und alle seine folgenden Geschwister, bis es eine andere title1 in einen Abschnitt Element trifft. Irgendwelche Ideen?
Vielen Dank im Voraus.