| View previous topic :: View next topic |
| Author |
Message |
visibleman
Joined: 13 Aug 2008 Posts: 3
|
Posted: Wed Aug 13, 2008 9:33 pm Post subject: XSL help |
|
|
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
p.s - also, is there documentation regarding IceCast XSL/XML support? |
|
| Back to top |
|
 |
visibleman
Joined: 13 Aug 2008 Posts: 3
|
Posted: Thu Aug 14, 2008 5:29 pm Post subject: |
|
|
Have currently bodged it using the following -
| Code: |
<xsl:choose>
<xsl:when test="sources > 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!  |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Aug 14, 2008 7:04 pm Post subject: |
|
|
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 |
|
 |
visibleman
Joined: 13 Aug 2008 Posts: 3
|
Posted: Fri Aug 15, 2008 10:04 am Post subject: |
|
|
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.
 |
|
| Back to top |
|
 |
|