<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" > <xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Transitiona l//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" indent="yes" encodin g="UTF-8" /> <xsl:template match = "/icestats" > <icecast> <xsl:for-each select="source"> <source mount="{@mount}"> <xsl:choose> <xsl:when test="listener"> <xsl:for-each select="listener"> <xsl:variable name = "themount"><xsl:value-of select="@mount" /></xsl:variable> <ip><xsl:value-of select="IP" /></ip> </xsl:for-each> </xsl:when> </xsl:choose> </source> </xsl:for-each> </icecast> </xsl:template> </xsl:stylesheet>
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" > <xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" indent="yes" encoding="UTF-8" /> <xsl:template match = "/icestats" > <icecast> <xsl:for-each select="source"> <source mount="{@mount}"> <listeners><xsl:value-of select="listeners" /></listeners> <listener_peak><xsl:value-of select="listener_peak" /></listener_peak> <maxlisteners><xsl:value-of select="max_listeners" /></maxlisteners> <bitrate><xsl:value-of select="bitrate" /></bitrate> <title><xsl:value-of select="title" /></title> </source> </xsl:for-each> </icecast> </xsl:template> </xsl:stylesheet>
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" > <xsl:output omit-xml-declaration="yes" method="text" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="no" encoding="UTF-8" /> <xsl:template match = "/icestats" > <xsl:for-each select="source"> <xsl:for-each select="listener"> <xsl:value-of select="IP" /> <xsl:text> </xsl:text> </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet>
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" > <xsl:output omit-xml-declaration="yes" method="text" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="no" encoding="UTF-8" /> <xsl:template match = "/icestats" > <xsl:for-each select="source"> <xsl:for-each select="listener"> <xsl:if test="username"> (<xsl:value-of select="username" /><xsl:text> - </xsl:text>)</xsl:if><xsl:value-of select="IP" /> <xsl:text> </xsl:text> </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet>
<xsl:template match = "/icestats" >
<xsl:text> ACTIVE USERS: </xsl:text>
<xsl:for-each select="listener">
<xsl:variable name = "themount"><xsl:value-of select="@mount" /></xsl:variable>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" encoding="UTF-8" /> <xsl:template match = "/icestats" > <xsl:for-each select="source"> <xsl:choose> <xsl:when test="listener"> <xsl:variable name = "themount"><xsl:value-of select="@mount" /></xsl:variable> <xsl:for-each select="listener"> <xsl:value-of select="IP" /> <xsl:if test="username"> (<xsl:value-of select="username" />) </xsl:if> <xsl:value-of select="Connected" /> <xsl:value-of select="UserAgent" /> </xsl:for-each> </xsl:when> </xsl:choose> </xsl:for-each> </xsl:template> </xsl:stylesheet>