Re: [xsl] Two possible group-ending-with nodes

Subject: Re: [xsl] Two possible group-ending-with nodes
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 6 Jan 2023 14:52:30 -0000
Am 1/6/2023 um 3:42 PM schrieb rick@xxxxxxxxxxxxxx:
>
> Hi All,
>
> I am trying to add some hierarchy to flat content. I have this as an
> input file:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <root>
>
> B B B  <p class="CBNote"/>
>
> B B B  <p class="CBNoteBody"/>
>
> B B B  <p class="CBBodyIndented" style="margin-left:96px;"/>
>
> B B B  <p class="CBBodyIndented"/>
>
> B B B  <p class="CBBody"/>
>
> </root>
>
> This is my desired output:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <root>
>
> B B B  <div class="note">
>
> B B B B B B B  <div class="note-header">
>
> B B B B B B B B B B B  <p class="CBNote"/>
>
> B B B B B B B  </div>
>
> B B B B B B B  <div class="note-content">
>
> B B B B B B B B B B B  <p class="CBNoteBody"/>
>
> B B B B B B B B B B B  <p class="CBBodyIndented"
style="margin-left:96px;"/>
>
> B B B B B B B  </div>
>
> B B B  </div>
>
> B B B  <p class="CBBodyIndented"/>
>
> B B B  <p class="CBBody"/>
>
> </root>
>
> After the note-header, the bottom boundary of the note content is
> either one of these:
>
>
p[@class='CBNoteBody']|p[@class='CBBodyIndented'][@style='margin-left:96px;']
>

If the p with class=CBNoteBody indicates the "end" of a note or at least
a note's content, why does your example have the <p
class="CBBodyIndented" style="margin-left:96px;"/> converted to <p
class="CBBodyIndented" style="margin-left:96px;"/> inside of the note
and note content?

Current Thread