我正在使用 Ecrion 的 Design Studio Publisher 使用 xml 源设计模板。我正在尝试使用 xpath 或 xsl 实现以下目标,但不确定如何
例如:我有以下 xml 文件
<?xml version="1.0" encoding="utf-8"?>
<DOCUMENT>
<PLAN>
<PLANNAME>Plan 1</PLANNAME>
<BENEFITS>
<INSURANCE>
<CATEGORY ID="1">
<LABEL>Insurance 1</LABEL>
<PREMIUM>Premium 1</PREMIUM>
<INNETWORK>In network 1</INNETWORK>
</INSURANCE>
<INSURANCE>
<CATEGORY ID="2">
<LABEL>Insurance 2</LABEL>
<PREMIUM>Premium 4</PREMIUM>
<INNETWORK>In network 4</INNETWORK>
</INSURANCE>
</BENEFITS>
</PLAN>
<PLAN>
<PLANNAME>Plan 2</PLANNAME>
<BENEFITS>
<INSURANCE>
<CATEGORY ID="1">
<LABEL>Insurance 1</LABEL>
<PREMIUM>Premium 2</PREMIUM>
<INNETWORK>In network 2</INNETWORK>
</INSURANCE>
<INSURANCE>
<CATEGORY ID="2">
<LABEL>Insurance 2</LABEL>
<PREMIUM>Premium 5</PREMIUM>
<INNETWORK>In network 5</INNETWORK>
</INSURANCE>
</BENEFITS>
</PLAN>
<PLAN>
<PLANNAME>Plan 3</PLANNAME>
<BENEFITS>
<INSURANCE>
<CATEGORY ID="1">
<LABEL>Insurance 1</LABEL>
<PREMIUM>Premium 3</PREMIUM>
<INNETWORK>In network 3</INNETWORK>
</INSURANCE>
<INSURANCE>
<CATEGORY ID="2">
<LABEL>Insurance 2</LABEL>
<PREMIUM>Premium 6</PREMIUM>
<INNETWORK>In network 6</INNETWORK>
</INSURANCE>
</BENEFITS>
</PLAN>
</DOCUMENT>
我想以如下表格格式显示以上内容
<table style="width: 252px;" border="0" cellspacing="0" cellpadding="0"><colgroup><col span="3" width="84" /> </colgroup>
<tbody>
<tr>
<td class="xl65" style="text-align: center;" width="84" height="21">Plan 1</td>
<td class="xl65" style="text-align: center;" width="84">Plan 2</td>
<td class="xl65" style="text-align: center;" width="84">Plan 3</td>
</tr>
<tr>
<td class="xl66" style="text-align: center;" colspan="3" height="21">Insurance 1</td>
</tr>
<tr>
<td class="xl65" style="text-align: center;" height="21">Premium 1</td>
<td class="xl65" style="text-align: center;">Premium 2</td>
<td class="xl65" style="text-align: center;">Premium 3</td>
</tr>
<tr>
<td class="xl65" style="text-align: center;" height="21">In network 1</td>
<td class="xl65" style="text-align: center;">In network 2</td>
<td class="xl65" style="text-align: center;">In network 3</td>
</tr>
<tr>
<td class="xl66" style="text-align: center;" colspan="3" height="21">Insurance 2</td>
</tr>
<tr>
<td class="xl65" style="text-align: center;" height="21">Premium 4</td>
<td class="xl65" style="text-align: center;">Premium 5</td>
<td class="xl65" style="text-align: center;">Premium 6</td>
</tr>
<tr>
<td class="xl65" style="text-align: center;" height="21">In network 4</td>
<td class="xl65" style="text-align: center;">In network 5</td>
<td class="xl65" style="text-align: center;">In network 6</td>
</tr>
</tbody>
</table>
<p> </p>
如果上表不起作用,请道歉。它应该看起来像这样
-------------------------------------------------
Plan 1 | Plan 2 | Plan 3
-------------------------------------------------
Insurance 1
-------------------------------------------------
Premium 1 | Premium 2 | Premium 3
-------------------------------------------------
In network 1 | In network 2 | In network 3
-------------------------------------------------
Insurance 2
-------------------------------------------------
Premium 4 | Premium 5 | Premium 6
-------------------------------------------------
In network 4 | In network 5 | In network 6
-------------------------------------------------