您好,我正在尝试为以下 xml 提供样式表: 但是我只是不知道我的 xpath 出了什么问题。我试过引用每个网站,但它只是不呈现。
<careTeames>
<careteame>
<PCP>JONES,MARY</PCP>
<type>Ped - Under 5</type>
<caregivers/>
<providers>
<provider>Henderson,Wilson</provider>
<providertype>Cardilogist</providertype>
<provider>H,WILLIAM</provider>
<providertype>OPTHOMOLGY</providertype>
</providers>
</careteame>
<careteame>
<PCP>JONES,MARY2</PCP>
<type>Ped - Under 5</type>
<caregivers/>
<providers>
<provider>Henderson,Wilson2</provider>
<providertype>Cardilogist2</providertype>
<provider>H,WILLIAM2</provider>
<providertype>OPTHOMOLGY2</providertype>
</providers>
</careteame>
</careTeames>
我只想要一个简单的输出:
PCP JONES, MARY
PROVIDERS Henderson, Wilson
H, William
我的 xsl 能够生成 PCP 的第一行,但是另一个 for-each 失败:(
<xsl:template match="/">
<html>
<body>
<h2>Data</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>col1</th>
<th>col2</th>
</tr>
<xsl:for-each select="return/careTeames/careteame">
<tr>
<td><xsl:value-of select="PCP" /></td>
<td><xsl:value-of select="type" /></td>
</tr>
<xsl:for-each select="return/careTeames/careteame/caremanagers">
<tr><td><xsl:value-of select="caremanagertype"/></td><td>( <xsl:value-of select="caremanagertype"/> )</td></tr>
</xsl:for-each>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>