0
我是xsl的新手,並試圖使用xslt將soap響應轉換爲簡單的html。我想要的結果應該在段落列表中顯示每個siteSummaryList節點的子節點。我的問題是,輸出只顯示第一個匹配(下面的例子中的測試站點1)。奇怪的是,它顯示了兩次,表明它找到了第二個匹配,但又顯示了第一個數據。任何人都可以看到或解釋我做錯了嗎?只顯示第一個匹配的XSLT轉換
感謝
XML
<ns:getSitesResponse xmlns:ns="http://scada.api.web.companyx">
<ns:return
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ax226="http://scada.response.entity.web.companyx/xsd" xsi:type="ax226:SiteSummaryResponse">
<ax226:siteSummaryList xsi:type="ax226:SiteSummary">
<ax226:alarmCount>8</ax226:alarmCount>
<ax226:label>TEST SITE 1</ax226:label>
<ax226:typeLabel>TYPE 1</ax226:typeLabel>
</ax226:siteSummaryList>
<ax226:siteSummaryList xsi:type="ax226:SiteSummary">
<ax226:alarmCount>6</ax226:alarmCount>
<ax226:label>TEST SITE 2</ax226:label>
<ax226:typeLabel>TYPE 2</ax226:typeLabel>
</ax226:siteSummaryList>
</ns:return>
</ns:getSitesResponse>
XSLT
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:p="http://scada.response.entity.web.companyx/xsd" exclude-result-prefixes="p">
<xsl:output method="html" indent="no" />
<xsl:template match="/">
<xsl:apply-templates select="//p:siteSummaryList" />
</xsl:template>
<xsl:template match="//p:siteSummaryList">
<p><xsl:value-of select="//p:label" /></p>
<p><xsl:value-of select="//p:typeLabel" /></p>
<p><xsl:value-of select="//p:alarmCount" /></p>
</xsl:template>
</xsl:stylesheet>