| View previous topic :: View next topic |
| Author |
Message |
woogieman

Joined: 11 Apr 2009 Posts: 33 Location: Eugene, OR. USA
|
Posted: Tue Feb 09, 2010 8:26 pm Post subject: XSL file help?? |
|
|
@karlH: I have a fairly technical question. Some background first.
I created an .xsl file which is located in the /usr/local/share/icecast/web/ directory on my icecast2 server.
This file is listed below so you can see the point of my question.
| 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>
Mount, Genre, Bitrate, Channels, Samplerate, Listener Peak, Listeners, Listen URL, Max Listeners, Public, Server Description, Server Name, Server Type, Server URL, Slow Listeners, Source IP, Stream Start, Total Bytes Read, Total Bytes Sent
<xsl:for-each select="source">
<xsl:value-of select="@mount" />|<xsl:value-of select="genre" />|<xsl:value-of select="ice-bitrate" />|
<xsl:value-of select="ice-channels" />|<xsl:value-of select="ice-samplerate" />|<xsl:value-of select="listener_peak" />|
<xsl:value-of select="listeners" />|<xsl:value-of select="listenurl" />|<xsl:value-of select="max_listeners" />|
<xsl:value-of select="public" />|<xsl:value-of select="server_description" />|<xsl:value-of select="server_name" />|
<xsl:value-of select="server_type" />|<xsl:value-of select="server_url" />|<xsl:value-of select="slow_listeners" />|
<xsl:value-of select="source_ip" />|<xsl:value-of select="stream_start" />|<xsl:value-of select="total_bytes_read" />|
<xsl:value-of select="total_bytes_sent" />
_END_
</xsl:for-each>
</pre>
</xsl:template>
</xsl:stylesheet> |
This is a modified version of a file I found on the forum. Can't remember the author and I'm sorry.
This file works great and returns all the data for every mount on that port.
Now on to my question.
I have another file called listeners.xsl that uses the same approach but it doesn't work.
This is modified from the listclients.xsl file located in the /admin directory.
It is loaded using the following command line.
http://ip.ip.ip:port/listeners.xsl?mount=/MountName
| 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>
IP Address, Time Connected, Media Player
<xsl:for-each select="source">
<xsl:variable name = "themount" ><xsl:value-of select="@mount" /></xsl:variable>
<xsl:for-each select="listener">
<xsl:value-of select="IP" />|<xsl:value-of select="Connected" />|<xsl:value-of select="UserAgent" />|_END_
</xsl:for-each>
</xsl:for-each>
</pre>
</xsl:template>
</xsl:stylesheet> |
This file is also located in the /web directory. I think that the problem may be authentication?
Can you help please?? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Tue Feb 09, 2010 9:16 pm Post subject: |
|
|
Actually this exposes 2 restrictions for 2.3.2. The webroot pages don't have access to the listeners details and secondly the adminroot pages have fixed filenames. The kh tree does allow for general xsl pages to be placed in adminroot with access to listener details, you would then use ?mount=/.... and supply the source auth to retrieve that info.
karl. |
|
| Back to top |
|
 |
woogieman

Joined: 11 Apr 2009 Posts: 33 Location: Eugene, OR. USA
|
Posted: Wed Feb 10, 2010 3:58 pm Post subject: XSL file help?? |
|
|
But I am using the /web directory for my files. I know about the admin directory stuff. Saw it in the source code.
Both xsl files I am showing you are in the /web directory.
Sorry I wasn't specific. I thought I was.
| Quote: |
Now on to my question.
I have another file called listeners.xsl that uses the same approach but it doesn't work.
This is modified from the listclients.xsl file located in the /admin directory.
It is loaded using the following command line.
http://ip.ip.ip.ip:port/listeners.xsl?mount=/MountName
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>
IP Address, Time Connected, Media Player
<xsl:for-each select="source">
<xsl:variable name = "themount" ><xsl:value-of select="@mount" /></xsl:variable>
<xsl:for-each select="listener">
<xsl:value-of select="IP" />|<xsl:value-of select="Connected" />|<xsl:value-of select="UserAgent" />|_END_
</xsl:for-each>
</xsl:for-each>
</pre>
</xsl:template>
</xsl:stylesheet>
This file is also located in the /web directory. I think that the problem may be authentication?
|
|
|
| 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
|