[xsl] How to collect the content of the inline siblings into a single element.

Subject: [xsl] How to collect the content of the inline siblings into a single element.
From: "Rajagopal CV cvr3@xxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 28 Dec 2024 04:26:18 -0000
Kindly assist me with an XSL code needed to generate the output I have
shared below.

Thanks,

Rajagopal


*Input XML *

<?xml version="1.0"?>

<root>

    <content>

        <p>Some text before</p>

        <div>

            <strong>First</strong>

            <strong>Second</strong>

         </div>

         <div>some texts </div>

          <div>Other text

                <strong>ABC</strong>

                <strong>DEF</strong>

                <strong>IJK</strong>

                 some text nodea

                <strong>JJJJ</strong>

                <strong>HHH</strong>

            </div>

            <div>

                <strong>First</strong>

                <strong>Second</strong>

           </div>

        </content>

</root>


*I want the following output. I want to flatten out the <strong> element. *


<?xml version="1.0"?>

<root>

    <content>

        <p>Some text before</p>

        <div>

            <strong>FirstSecond</strong>

         </div>

         <div>some texts </div>

          <div>Other text

                <strong>ABCDEFIJK</strong>

                 some text nodes

                <strong>JJJJHHH</strong>

            </div>

            <div>

                <strong>FirstSecond</strong>

           </div>

        </content>

</root>

Current Thread