On Thursday 22 July 2004 04:56, Myke Place wrote:> I'm curious if it is possible to create custom .xsl files in the /admin > directory, using the same xsl params that appear in in the web > interfaces that ship with Icecast2.Yes. Though I don't know if using an arbitrary one works from the admin directory. Certainly you can put them in icecast's webroot directory (or some subdirectory of that).> Here's an example that (currently) isn't working for me. Any help or > comments on the way Icecast2 handles the processing of these files would > be super: > > <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" > version = "1.0" > > <xsl:output method="html" indent="yes" /> > <xsl:template match = "/icestats" > > <HTML> > <HEAD> > <title>Simple Icecast stats</title> > </HEAD> > <BODY> > <xsl:for-each select="source"> > <xsl:value-of select="@mount" /> > <br>Your XSLT must be valid.This isn't well-formed XML, you need: <br/>. The rest looks ok. Mike
Just a followup, hopefully my experiences will help somebody else. Comments inline... * Michael Smith (msmith@xiph.org) [040721 19:24] spake thusly:> On Thursday 22 July 2004 04:56, Myke Place wrote: > > I'm curious if it is possible to create custom .xsl files in the /admin > > directory, using the same xsl params that appear in in the web > > interfaces that ship with Icecast2. > > Yes. Though I don't know if using an arbitrary one works from the admin > directory. Certainly you can put them in icecast's webroot directory (or some > subdirectory of that).I was interested to find that inside the /admin directory, it doesn't appear that even properly formatted XSL will work _unless_ one of the exisiting files is replaced by a file of the same name. For instance, copying listmounts.xsl to test.xsl and then trying to access test.xsl will not work. It seems that one must use a file with one of the names already existing. If there is a way around this, I would love to hear about it.> > Here's an example that (currently) isn't working for me. Any help or > > comments on the way Icecast2 handles the processing of these files would > > be super: > > > > <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" > > version = "1.0" > > > <xsl:output method="html" indent="yes" /> > > <xsl:template match = "/icestats" > > > <HTML> > > <HEAD> > > <title>Simple Icecast stats</title> > > </HEAD> > > <BODY> > > <xsl:for-each select="source"> > > <xsl:value-of select="@mount" /> > > <br> > > Your XSLT must be valid.This isn't well-formed XML, you need: > <br/>.Indeed, this is the case. Silly me. Thanks for catching that.> The rest looks ok. > > Mike > > _______________________________________________ > Icecast mailing list > Icecast@xiph.org > http://lists.xiph.org/mailman/listinfo/icecast >
<20040722172806.GA32609@xmission.com> Message-ID: <6.0.1.1.2.20040722131000.03718050@www.oddsock.org> At 12:28 PM 7/22/2004, you wrote:>Just a followup, hopefully my experiences will help somebody else. >Comments inline... > >* Michael Smith (msmith@xiph.org) [040721 19:24] spake thusly: > > On Thursday 22 July 2004 04:56, Myke Place wrote: > > > I'm curious if it is possible to create custom .xsl files in the /admin > > > directory, using the same xsl params that appear in in the web > > > interfaces that ship with Icecast2. > > > > Yes. Though I don't know if using an arbitrary one works from the admin > > directory. Certainly you can put them in icecast's webroot directory > (or some > > subdirectory of that). > >I was interested to find that inside the /admin directory, it doesn't >appear that even properly formatted XSL will work _unless_ one of the >exisiting files is replaced by a file of the same name. For instance, >copying listmounts.xsl to test.xsl and then trying to access test.xsl >will not work. It seems that one must use a file with one of the names >already existing. If there is a way around this, I would love to hear >about it.since the xslt in the admin directory does specialized logic (such as possibly kicking users, moving mountpoints, etc) icecast does some specific checking on the xslt name in order to trigger it's actions... For instance, the "listclients" xslt works on a different XML document than does "listmounts". So it is definately the case that in the admin directory, you can't add new features and functionality by dropping in xslt files, you need to do that PLUS add a handler for that specialized function in the icecast code. This is different than the xslt transforms that are in the "web" directory. Those, all operate on the same XML document (the one returned by the /admin/stats.xml request)...You can put any valid xslt transform in there and icecast will transform it using the stats XML document. You can also directly modify the xslt transforms in admin, although you cannot rename them, you can edit/change/enhance them. If you want to see the XML document that is applied to each admin xslt, just change the .xsl to .xml in your request (i.e. /admin/listclients.xml). You can then code your xslt transform appropriately. hope that clears it up.. oddsock