[xsl] Split table row on paragraphs

Subject: [xsl] Split table row on paragraphs
From: "kevinbrianbird@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Oct 2018 16:45:59 -0000
Hello,

 

I have tables with arbitrary columns and each cell can have an arbitrary
number of paragraphs. I want to split rows on paragraphs, so each row only
contains one <p> element.

 

Simplified input:

 

<table>

    <tr>

        <td>

            <p>Para 1</p>

        </td>

        <td>

            <p>Para 1</p>

            <p>Para 2</p>

            <p>Para 3</p>

        </td>

        <td>

            <p>Para 1</p>

            <p>Para 2</p>

        </td>

    </tr>

</table>

 

Desired output:

 

<table>

    <tr>

        <td>

            <p>Para 1</p>

        </td>

        <td>

            <p>Para 1</p>

        </td>

        <td>

            <p>Para 1</p>

        </td>

    </tr>

    <tr>

        <td>

        </td>

        <td>

            <p>Para 2</p>

        </td>

        <td>

            <p>Para 2</p>

        </td>

    </tr>

    <tr>

        <td>

        </td>

        <td>

            <p>Para 3</p>

        </td>

        <td>

        </td>

    </tr>

</table>

 

I am after suggestions as to the best way of tackling such a problem.

 

Many thanks.

 

--

Kevin

Current Thread