我在实现这个 XSLT 时遇到了问题,我需要从以下 XML 创建一个 HTML 表:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Overview>
<Header>
<Column name="SysRepositoryLabel_Language" width="10%" align="center">Lingua</Column>
<Column name="SysRepositoryLabel_Text" width="45%" align="left">Testo</Column>
<Column name="SysRepositoryLabel_Usage" width="45%" align="left">Uso</Column>
</Header>
<Rows>
<Row row="0">
<Column name="SysRepositoryLabel_PKey">1</Column>
<Column name="SysRepositoryLabel_Language">it</Column>
<Column name="SysRepositoryLabel_Text">Accedi al Sistema</Column>
<Column name="SysRepositoryLabel_Usage">AppMenuLabelLogIn</Column>
</Row>
<Row row="1">
<Column name="SysRepositoryLabel_PKey">2</Column>
<Column name="SysRepositoryLabel_Language">en</Column>
<Column name="SysRepositoryLabel_Text">LogIn</Column>
<Column name="SysRepositoryLabel_Usage">AppMenuLabelLogIn</Column>
</Row>
<Row row="2">
<Column name="SysRepositoryLabel_PKey">3</Column>
<Column name="SysRepositoryLabel_Language">it</Column>
<Column name="SysRepositoryLabel_Text">Archivio</Column>
<Column name="SysRepositoryLabel_Usage">AppMenuLabelMasterData</Column>
</Row>
</Rows>
</Overview>
这是我想获得的表格:
<table width="100%" cellpadding="0" cellspacing="0" border="0>
<tr>
<td width="10%" align="center" valign="center">Lingua</td>
<td width="45%" align="left" valign="center">Testo</td>
<td width="45%" align="left" valign="center">Uso</td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="10%" align="center" valign="center">it</td>
<td width="45%" align="left" valign="center">Accedi al Sistema</td>
<td width="45%" align="left" valign="center">AppMenuLabelLogIn</td>
</tr>
<tr>
<td width="10%" align="center" valign="center">en</td>
<td width="45%" align="left" valign="center">LogIn</td>
<td width="45%" align="left" valign="center">AppMenuLabelLogIn</td>
</tr>
<tr>
<td width="10%" align="center" valign="center">it</td>
<td width="45%" align="left" valign="center">Archivio</td>
<td width="45%" align="left" valign="center">AppMenuLabelMasterData</td>
</tr>
</table>
在节点 Header 中,我必须用这个新表的列数和一些属性来作为表的标题,作为文本的宽度和 aling。在节点行中,我有要放入表中的数据,行数应该多于表头之一,但只有表头中的当前值也应该导出到第二个表中。
非常感谢帕斯夸莱