Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

status modifcation

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Wed Jan 04, 2006 3:18 pm    Post subject: status modifcation Reply with quote

Hi,

I am no expert in xsl style sheets.
But would like to have a xsl sheet displaying certain information e.g. song info. I have modified an existing sheet that is nearly doing what i want. The only thing I can not figure out is how to get the details for a specific mount point. This sheet produce the information for all mountpoints. Can some one help me how to modify this sheet that it shows only the information from 1 mountpoint instead of all connected mounts.

The xsl sheet:

<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>
<xsl:for-each select="source">
<xsl:value-of select="@mount" /> - <xsl:value-of select="name" /> <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>

Thanks in advance!

RoN
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Wed Jan 04, 2006 4:28 pm    Post subject: Reply with quote

You'll have to be more selective within the for-each, to match on only a specific mountpoint name. I'm not an xslt guru myself so I can't remember if the xsl:if will be sufficient but I think it is.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Guest






PostPosted: Thu Jan 05, 2006 2:06 pm    Post subject: Reply with quote

Karl,
Thanks for your reply!
I do think your gues is correct, however I cannot get this to work.
When i try something like this ... i get no result Sad

<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>
<xsl:for-each select="source">
<xsl:if test=”/mount1”>
<xsl:value-of select="@mount" /> : <xsl:value-of select="artist" /> <xsl:value-of select="title" />.
</xsl:if>
</xsl:for-each>
</pre>
</xsl:template>
</xsl:stylesheet>

I have no clue how to proceed, hope someone can help me to solve this puzzle.

RoN
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Thu Jan 05, 2006 2:37 pm    Post subject: Reply with quote

I'm only guessing here but maybe it's

<xsl:if test="@mount='/mount1'">

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MikeS
Code Warrior
Code Warrior


Joined: 29 Jun 2005
Posts: 73
Location: Barcelona, Spain

PostPosted: Thu Jan 05, 2006 3:21 pm    Post subject: Reply with quote

Anonymous wrote:

<xsl:for-each select="source">
<xsl:if test=”/mount1”>


I suspect you should replace the chunk above with something like:
<xsl:for-each select="source[@mount='mount1']">
...
</xsl:for-each>

... but I haven't written any XSLT for a while, so I might have some details wrong there.

Mike
Back to top
View user's profile Send private message Send e-mail
Anonymous
Guest





PostPosted: Fri Jan 06, 2006 8:38 pm    Post subject: Reply with quote

Karl & Mike,

Thanks for your help!
The advice form Mike did the job ..... I need to learn more from XSLT ...
but for now it does exactly what I want.

I'm a happy camper Smile

The complet script is now .....

<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>
<xsl:for-each select="source[@mount='/mount']">
<xsl:value-of select="artist" /> <xsl:value-of select="title" />
</xsl:for-each>
</pre>
</xsl:template>
</xsl:stylesheet>
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
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