使用XSLT 1.0,兄弟元素转换为html表

时间:2017-05-23 11:25:27

标签: xml xslt xslt-1.0

我将两个兄弟元素内容转换为html表。第一个元素包含" Journal-ID"第二个元素包含" Article-ID"

示例输入:

<root>
<journal-article>
    <journal>ARJ</journal>
    <article>10,12,14,18</article>
</journal-article>
<journal-article>
    <journal>BMJ</journal>
    <article>10,13,15,18</article>
</journal-article>
<journal-article>
    <journal>CAT</journal>
    <article>13,22,14,28</article>
</journal-article>

必须转换为

&#13;
&#13;
    <html>
    <body>
    <table>
    <tr>
    <td>Article</td>
    <td>Journals Affected</td>
    </tr>
        <tr>
            <td>10</td>
            <td>ARJ,BMJ</td>
        </tr>
        <tr>
            <td>12</td>
            <td>ARJ</td>
        </tr>
        <tr>
            <td>13</td>
            <td>BMJ,CAT</td>
        </tr>
        <tr>
            <td>14</td>
            <td>ARJ,CAT</td>
        </tr>
        <tr>
            <td>15</td>
            <td>BMJ</td>
        </tr>
        <tr>
            <td>18</td>
            <td>ARJ,BMJ</td>
        </tr>
        <tr>
            <td>22</td>
            <td>CAT</td>
        </tr>
        <tr>
            <td>28</td>
            <td>CAT</td>
        </tr>
    </table>
    </body>
    </html>
&#13;
&#13;
&#13;

请注意,该应用程序仅支持XSLT 1.0版本

0 个答案:

没有答案