Embed-code.xsl
This is an open discussion with 4 replies, filed under XSLT.
Search
would you mind posting your <xsl:template name="flash-embed">
sure, here you go..
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template name="flash-embed"> <xsl:param name="flash"/> <xsl:param name="width"> 100% </xsl:param> <xsl:param name="height"> 100% </xsl:param> <xsl:param name="class"/> <xsl:param name="clicktag"/> <xsl:variable name="flash-url"> <xsl:value-of select="$workspace"/> <xsl:value-of select="$flash/@path"/> <xsl:text>/</xsl:text> <xsl:value-of select="$flash/filename"/> </xsl:variable> <div class="nox-flash" style="width:{$width}px;height:{$height}px;visibility:hidden" title="{$clicktag}"> <xsl:value-of select="$flash-url"/> </div> <!-- ?cachekiller={$today}-{$current-time} --> <!--<object id="nox-flash" height="{$height}" width="{$width}" type="application/x-shockwave-flash" name="nox-flash" data="{$flash-url}"> <param name="menu" value="false"/> <param name="wmode" value="transparent"/> <param name="movie" value="{$flash-url}"/> <PARAM NAME="flashvars" VALUE="workspace={$workspace}&clickTag={$clicktag}"/> <embed flashvars="workspace={$workspace}" width="{$height}" height="{$width}" src="{$flash-url}" name="nox-flash" wmode="transparent" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/> </object>--> </xsl:template> </xsl:stylesheet>
let me know if you need anything else.. i’m pretty desperate for a resolution.. i can make donations whatever, etc..
I see quite a few problems with your template but without seeing all of the XSLT code, including your XML source, I cannot be sure. Here’s a list of oddities that I’ve found:
Q1. Why do you have a template that is matching the data
element but it’s empty? This might not be a problem, depending on the other XSLT files you are importing but it’s worth noting.
Q2. You have an apply-templates
, that’s applying to data/collection-items/entry/text
but I don’t see a matching template for it.
In XSLT, if you don’t have a matched template that you are applying, it will try to spit the literal data value out to HTML. Since data/collection-items/entry/text
is likely just text, it is outputting the text values. For the other two templates you are trying to apply, they most likely do not contain text but XML elements with attributes.
The rule is, for every template you are trying to apply, you need a matching template counter-part. If you just want to grab values, use <xsl:value-of select="data/collection-items/entry/text"/>
instead.
Q3. You are importing master.xsl
and use-media.xsl
. We need to see what’s in those to be able to get a full picture.
When submitting XML/XSLT questions, it is best to use a public code past-board service like http://pastie.org/ to post all your relevant code. This includes all your relevant XSLT files (including anything you’re importing) and your XML source.
By the way, the site you’re building looks very good :)
okay, so now i have the entry made into the CMS parsing onto the website
there was nothing wrong with the XSL code.
<xsl:value-of select="data/collection-items/entry/embed"/>
I had to enter a variable ‘embed’ to the array in the php code for data.collection_items.php
public $dsParamINCLUDEDELEMENTS = array( 'title', 'text: formatted', 'intro-image', 'intro-flash', 'detail-flash', 'embed' );
Now my problem lies in the XSL stripping out the tags. I need to parse HTML more specifically an IFRAME. I was thinking of formatting the stylesheet in a way where it would just pass through the IFRAME src value and have the rest hard coded into the style sheet.. Any suggestions?
Create an account or sign in to comment.
The following code parses the data entered into the CMS
But when I created a new Embed field for the same blueprint and used the following code it will NOT parse the data entered into the CMS
or
does not work.
below is the entire xsl file: