Exsl node-set and oembed youtube
This is an open discussion with 4 replies, filed under XSLT.
Search
Hey Moonoo,
This should work, with normal xslt;
<xsl:variable name="stringafter"><xsl:value-of select="substring-after(video/oembed/html,'src="')" /></xsl:variable> <xsl:variable name="code"><xsl:value-of select="substring-before($stringafter,'"')" /></xsl:variable> <div style="display:none"> <xsl:value-of select="$code"/> </div>
But why don't u just use the url node?
Cheers
I want to define width and height and Id's on the iframe that don't exist in the oembed code.. and youtube oembed doesn't provide the unique ID of the video as a spearate node..
I just string replaces the 'url' node in oembed to grab the ID and now it's sorted... he says :)
Thanks for the above though!
Yep, that was the same thing i did, rebuilding the iframe to set your own attributes...
I wonder if there's a better 'ninja technique' to grab attributes from a string?
I think the Ninja approach was what I was attempting.. but I only managed 'Kato' level of Ninja :p
Create an account or sign in to comment.
I've got a few videos that I need to grab just the youtube src attribute from an oembed XML output.
I thought I could grab this attribute with exslt:
But I just get an empty result..
I'm just after a string such as this: http://www.youtube.com/embed/VRNuKfBhehk?feature=oembed from an oembed script that has escaped iframe opening and closing tags..
Any toughts?