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 

XSL help

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



Joined: 13 Aug 2008
Posts: 3

PostPosted: Wed Aug 13, 2008 9:33 pm    Post subject: XSL help Reply with quote

Using
Code:
<xsl:for-each select="source">      <xsl:value-of select="artist" />     </xsl:for-each>
works fine, but I'm trying to grab the artist value of a specific mount(stream) and i'm using
Code:
<xsl:value-of select="source/Stream.ogg/artist" />
but failing miserably (have also tried other combinations but still can't figure it all out).

Can anyone push me in the right direction?

Cheers all,
Dom Smile

p.s - also, is there documentation regarding IceCast XSL/XML support?
Back to top
View user's profile Send private message
visibleman



Joined: 13 Aug 2008
Posts: 3

PostPosted: Thu Aug 14, 2008 5:29 pm    Post subject: Reply with quote

Have currently bodged it using the following -
Code:
<xsl:choose>
  <xsl:when test="sources &gt; 0">
    <xsl:for-each select="source">
      <xsl:if test="@mount = '/Stream.ogg'">
        <a href="{listenurl}.m3u"><font face="arial" size="4" color="red"><b>LISTEN NOW</b></font></a><br/><br/>
        <font face="arial" size="2"><b>Currently Playing:<b> <xsl:value-of select="artist"/> - <xsl:value-of select="title"/></font>
      </xsl:if>
    </xsl:for-each>
  </xsl:when>
  <xsl:otherwise>
    <font face="arial" size="3" color="red"><b>Not Currently Streaming</b></font>
  </xsl:otherwise>
</xsl:choose>


but find it a little slow when having multiple mounts (ie: 10+) as it goes through each one (for each source), even though im only picking the one.

Ideally, i want to remove the for-each and call up a specific mount, but i'm thinking it's not doable.

Any help will be much appreciated! Smile
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Thu Aug 14, 2008 7:04 pm    Post subject: Reply with quote

I haven't tried it but what about something like

<xsl:for-each select="source[@mount='/Stream.ogg']"
<xsl:value-of select="artist"/>

or

<xsl:template match = "source[@mount='/Stream.ogg']"
...

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



Joined: 13 Aug 2008
Posts: 3

PostPosted: Fri Aug 15, 2008 10:04 am    Post subject: Reply with quote

Thanks Karl, will give it a go and see how far i get. I know someone else tried using source[@mount=''] and didn't get that far but eitherway i'll try it.

Very Happy
Back to top
View user's profile Send private message
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