Icecast contains an XSLT implementation based on libxslt from xmlsoft.
I want to know if it supports the node-set() function, preferably in a way that works for other web-only environments too:
Regrettably, the XSLT processor in icecast is only web accessible through the web interface of the icecast process (so no xsltproc on the commandline). To worsen it: there is limited logging of the XSLT errors (when you do things wrong, the icecast process often just dies).
I'm running icecast 2.3.2 as that is the latest Windows based build (there is no 2.3.3 build for Windows yet), which has libxslt.dll dated in 2008. There is no version number in the DLL, the best I can provide is this (see XSLT code at the bottom):
Version: 1.0
Vendor: libxslt
Vendor URL: http://xmlsoft.org/XSLT/
I tried running the node-set detection mentioned at David Carlisle's blog article The EXSLT node-set function pointed to by "How to use node-set function in a platform-independent way?".
From the output, I think that fails:
icemaster@localhost972990localhost00EarthIcecast 2.3.2Sun, 23 Jun 2013 20:02:19 W. Europe Daylight Time202200ice-samplerate=44100;ice-bitrate=64;ice-channels=264StationGenre6424410000http://localhost:8000.....
What would be the best way to find out through an XSL file in the web-interface?
Version script:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="text" encoding="UTF-8" />
<xsl:template match="/">
Version: <xsl:value-of select="system-property('xsl:version')" />
Vendor: <xsl:value-of select="system-property('xsl:vendor')" />
Vendor URL: <xsl:value-of select="system-property('xsl:vendor-url')" />
</xsl:template>
</xsl:stylesheet>
node-set script I tried:
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exslt="http://exslt.org/common"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
exclude-result-prefixes="exslt msxsl">
<xsl:output
omit-xml-declaration="no"
method="html"
indent="yes"
encoding="UTF-8" />
<msxsl:script language="JScript" implements-prefix="exslt">
this['node-set'] = function (x) {
return x;
}
</msxsl:script>
<xsl:variable name="x">
<y/>
</xsl:variable>
<xsl:template match="x">
<html>
<head><title>test exslt node set</title></head>
<body>
<xsl:apply-templates select="exslt:node-set($x)/*"/>
</body>
</html>
</xsl:template>
<xsl:template match="y">
<p>node set!</p>
</xsl:template>
</xsl:stylesheet>
Short answer
Generic answer
I created a solution, based on the CSTUG bibliography XSLT using the function system-property.
Please comment if this is indeed the correct way to do this.
The CSTUG code handles these node-set() functions:
I added support for these as well:
Output from icecast:
XSLT used: