| View previous topic :: View next topic |
| Author |
Message |
Anonymous Guest
|
Posted: Tue Feb 05, 2008 9:35 pm Post subject: xslt help |
|
|
I'm trying to figure out how to write a status2.xsl that can generate a page similar to this (in the exact same comma-separated format):
http://64.34.131.145:8001/status2.xsl
(this is not my site).
I need to generate my page exactly like that, here's what I've come up with:
http://dholcutzradio.com:8003/status2.xsl
using this code:
| Code: |
<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 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
<xsl:template match = "/icestats" >
<pre>
MountPoint,Connections,Stream Name,Current Listeners,Description,Currently Playing,Stream URL
Global,Client:<xsl:value-of select="connections" /> Source: <xsl:value-of select="source_connections" />,,<xsl:value-of select="listeners" />,,
<xsl:for-each select="source">
<xsl:value-of select="@mount" />,,<xsl:value-of select="name" />,<xsl:value-of select="listeners" />,<xsl:value-of select="description" />,<xsl:value-of select="artist" /> - <xsl:value-of select="title" />,<xsl:value-of select="url" />
</xsl:for-each>
</pre>
</xsl:template>
</xsl:stylesheet>
|
Can somebody make this work, I'm not sure why it doesn't work in IE (at all) and in firefox, why I can't make it look exactly like the other url.
My experience with xslt/xml is very limited. Thanks in advance. |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Wed Feb 13, 2008 11:53 pm Post subject: |
|
|
Ok I might've phrased the question wrong, but there is something seriously wrong with Icecast 2.1 KH and 3.1 KH, in the sense that the status2.xsl doesn't generate a valid page. I really need to use KH clients because the normal Icecast client doesn't let me run itself on a flash player (because of reaosns you already know).
Is there a fix for the KH clients that can generate a valid status2.xsl page.
Thank you. |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Feb 14, 2008 2:07 am Post subject: |
|
|
status2.xsl is not something I usually check for as it's really only a demonstration, so it hasn't been updated for a long time. Note that your streams will be missed out if they are marked as hidden.
Place the following into status2.xsl or any other file in webroot with a .xsl extension (no server restart is required).
| Code: |
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
<xsl:output method="text" media-type="text/plain" indent="yes" encoding="UTF-8" />
<xsl:template match = "/icestats" >
<pre>
Global,Clients:<xsl:value-of select="connections" />,Sources:<xsl:value-of select="source_client_connections" />,,<xsl:value-of select="listeners" />,,
MountPoint,Connections,Stream Name,Current Listeners,Description,Currently Playing,Stream URL
<xsl:for-each select="source">
<xsl:value-of select="@mount" />,<xsl:value-of select="listener_connections" />,<xsl:value-of select="server_name" />,<xsl:value-of select="listeners" />,<xsl:value-of select="server_description" />,<xsl:value-of select="artist" /> <xsl:value-of select="title" />,<xsl:value-of select="listenurl" />
</xsl:for-each>
</pre>
</xsl:template>
</xsl:stylesheet>
|
karl. |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Thu Feb 14, 2008 4:13 am Post subject: |
|
|
| Thank you! That fixed the problem. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group subRebel style by ktauber
|