【发布时间】:2018-04-25 07:24:50
【问题描述】:
我无法从 NrOfConvoys 和 annotationText 节点中找到最大值,下面是我的 XML 文件。
<InstructionListPosition>
<Instruction>
<Navigation>
<NrOfConvoys>2</NrOfConvoys>
<annotationText>5</annotationText>
</Navigation>
</Instruction>
</InstructionListPosition>
<InstructionListPosition>
<Instruction>
<Navigation>
<NrOfConvoys>20</NrOfConvoys>
<annotationText>10</annotationText>
</Navigation>
</Instruction>
</InstructionListPosition>
我想要输出如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--Disable Cache-->
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
<!--End-->
</head>
<body>
<div id="wrapper_all">
<table style="width:100%">
<tr>
<th>Sr. Num</th>
<th>Maximum value</th>
</tr>
<tr>
<td>1</td>
<td>5</td>
</tr>
<tr>
<td>2</td>
<td>20</td>
</tr>
</table>
</div>
</body>
</html>
我想要如上所示的输出,请您提供最佳解决方案。我正在使用 XSLT1.0。
请帮帮我,谢谢。
【问题讨论】:
-
您使用的 XSLT 是什么,它有什么问题?