Problems with embedding youtube with xslt transforms
I have multiple video links from youtube stored in an xml file, I have added code that will allow these to be embedded, xml element is video. Each element is stored in an outer element with an id, and only sections with each id are only visible one at a time. The pblem is that only 1 section has all of its videos embedded while others will either have none or will have the other sections videos. Code is shown below
<xsl:for-each select="item/items[@id='id1']">
<table>
<tr>
<th>Video</th>
<td></td>
<td>
<iframe width="512"
height="308"
src="{video}"
frameborder="0"></iframe>
</td>
</tr>
</table>
</xsl:for-each&开发者_开发技巧gt;
Is there another way to get this to work?
EDIT - Below is a sample xml file in the format of what I am transforming.
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="items.xsl"?>
<item>
<items id="id1">
<video>http://www.youtube.com/embed/0iCFi14Glbk</video>
</items>
<items id="id1">
<video>http://www.youtube.com/embed/rMCh4etBbkU</video>
</items>
These embedded videos should be displayed in a table as shown in the xsl above.
http://www.htmlgoodies.com/tutorials/web_graphics/article.php/3480061/How-To-Add-a-YouTube-Video-to-Your-Web-Site.htm
The link above shows the way in which i want this to work with the embeded video displayed
There was no problem with the code something was wrong with youtube
精彩评论