【发布时间】:2018-04-25 16:47:10
【问题描述】:
我需要在另一个公共 secuanci 中执行循环序列并获取每个人和每个状态的数据,我遇到的代码问题是它不会迭代我提供的数据。当我有空字段时,我需要第二个 for-each 的帮助,然后我可以使用 Word 内容控件
XML 文件
<?xml version="1.0"?>
<emailList>
<person>
<name>name 1</name>
<email>g@gmail.com</email>
<status>
<active>1</active>
<active>2</active>
<active>3</active>
</status>
</person>
<person>
<name>name 2</name>
<email>n@hotmail.com</email>
<status>
<active>4</active>
<active>5</active>
</status>
</person>
</emailList>
XSL 文件
<xsl:stylesheet version="1.0">
<html xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
<head>
<title>Email Listing</title>
</head>
<body>
<table>
<tr>
<th>Name</th>
<th>E-mail Address</th>
<th>Status</th>
</tr>
<xsl:for-each select="emailList/person">
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="email"/></td>
<td>
<xsl:for-each select="emailList/person/status">
<xsl:value-of select="active"/>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
【问题讨论】: