Search

Hello,

I thought that would be simple but I have a tiny issue with this all. I wanted to have each mp3 I would post embed into a “dewplayer”.

Basically, the idea would have been to post a link and then, do a template match like this:

<xsl:template match="p[contains(., '.mp3')]" mode="html">
    <xsl:element name="object">
        <xsl:attribute name="type">application/x-shockwave-flash</xsl:attribute>
        <xsl:attribute name="data">http://mynameiskaneel.com/workspace/swf/dewplayer.swf?mp3=<xsl:value-of select="." /></xsl:attribute>
        <xsl:attribute name="width">200</xsl:attribute>
        <xsl:attribute name="height">20</xsl:attribute>
        <xsl:element name="param">
            <xsl:attribute name="name">movie</xsl:attribute>
            <xsl:attribute name="value">http://mynameiskaneel.com/workspace/swf/dewplayer.swf?mp3=<xsl:value-of select="." /></xsl:attribute>
        </xsl:element>
        <xsl:element name="param">
            <xsl:attribute name="name">wmode</xsl:attribute>
            <xsl:attribute name="value">transparent</xsl:attribute>
        </xsl:element>
        <xsl:element name="param">
            <xsl:attribute name="name">flashvars</xsl:attribute>
            <xsl:attribute name="value">
                mp3=<xsl:value-of select="." />&amp;showtime=1
            </xsl:attribute>
        </xsl:element>
    </xsl:element>
    <small>
        <xsl:element name="a">
            <xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
            <xsl:attribute name="rel">nofollow</xsl:attribute>
            <xsl:text>(download it!)</xsl:text>
        </xsl:element>
    </small>
</xsl:template>

The issue comes from the way I always have been naming stuff on my HDs… basically artist-blabla-blabla… which get html-ed to artist-<em>blabla</em>-blabla and so, I can’t get this url properly.

Then, I tried to post a link (with <a>) and match the @href of this link but now, i’m in front of a wall as I don’t even know what to do next. I can’t put an object into a <a>, I need to go back but here it is, I’m blocked… is it even possible to say something like “go back and replace the a with whats next”.

<xsl:template match="p/a@href[contains(., '.mp3')]" mode="html">
</xsl:template>

I know I must not make much sense but here is how I’m lost at this very moment and I really hope someone will be able to help myself.

<xsl:template match="a[contains(@href, '.mp3')]" mode="html">
</xsl:template>

Sorry, the artist-<em>blabla</em>-blabla stuff didn’t make any sense to me. Can you give us an example of your XML, your XSLT and the result?

Ah damn, I already edited it many times. What I was saying is that it’s been “markdown-ed” as it was between two underscores.

And thank you! It works now. I didn’t know and even realize I could do it that way too… it opens a new world again!

Kaneel - thanks for posting the code!

@ashrimplin - how’s the site coming along? if you don’t mind, once you get your site up and running with this functionality, would you mind posting a link to your site?

@brian - really well, thanks! I have developed (to some extent) each section of my site. It’s currently still on my localhost.

I am currently grappling with the xmluploader tool. I will spend time working with it this weekend to try and get it to work. You going to be up at Crooked Tree anytime soon?

yep. just email me and let me know when you’ll be up there. i’ll be glad to help you get the xml importer working.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details