I have the following XML:
<page id="12095325">
<name>DUMMY TEST</name>
<description>Includes in- & outbound dial statistics</description>
<server>reg6699cic01</server>
<created>2015/02/19 11:57:05 AM</created>
<adhocmessage/>
<workgroups>
<workgroup>
<name>SSC_UK_Office_All</name>
<agents>24</agents>
<agentsavailable>0</agentsavailable>
<agentsloggedin>16</agentsloggedin>
<longestavailable>-</longestavailable>
<longestoutbound>4d 09:38:18</longestoutbound>
<longestinbound>00:00:34</longestinbound>
<longestnonacd>-</longestnonacd>
<numbernonacd>0</numbernonacd>
<numberoninbound>1</numberoninbound>
<numberoninboundinacw>3</numberoninboundinacw>
<numberonoutbound>4</numberonoutbound>
<numberonoutboundinacw>1</numberonoutboundinacw>
<agentstatus/>
</workgroup>
</workgroups>
<agentstats>
<agent>
<name>Aaron.House</name>
<firstname>Aaron</firstname>
<lastname>House</lastname>
<extension>902030</extension>
<station/>
</agent>
</agentstats>
</page>
When I apply a template that matches the <agentstats>
I do get information from the whole xml rather than the agentstats section only?
I try to understand why. This is the xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result- prefixes="msxsl">
<xsl:param name="row-count" select="3"/>
<xsl:output method="html" encoding="utf-8" indent="yes"/>
<xsl:template match="agentstats">
<!-- <xsl:call-template name="agents"/> -->
</xsl:template>
<xsl:template name="agents">
<table border="1">
<tr>
<td>Agent Name</td>
<td>Station</td>
<td>Status</td>
</tr>
<xsl:for-each select="agent">
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="station"/></td>
<td><xsl:value-of select="currentstatus"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
And this is the output generated:
I would not expect to see the first line:
DUMMY TEST Includes in- & outbound dial statistics reg6699cic01 2015/02/19 11:57:05 AM SSC_UK_Office_All 24 0 16 - 4d 09:38:18 00:00:34 - 0 1 3 4 1
but rather the table only
Any ideas what's happening here? Regards