This is a migrated thread and some comments may be shown as answers.

[Solved] Invalid xhtml content for flash element

5 Answers 107 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Henk Huisman
Top achievements
Rank 1
Henk Huisman asked on 28 Oct 2009, 12:35 PM

Hi,

Using RadControls for ASP.NET AJAX version 2007.3 1425 (Feb 25, 2008) and Internet Explorer 7 (version 7.0.5730.13), I am trying to paste a flash element in the RadEditor with the following clientside script:
    var ieFilter = editor._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
    var ffFilter = editor._filtersManager.getFilterByName("MozillaKeepFlashString");
    if (ieFilter) strXhtml = ieFilter.getDesignContent(strXhtml);
    if (ffFilter) strXhtml = ffFilter.getDesignContent(strXhtml);
    editor.pasteHtml(strXhtml);

Before this code is executed, the strXhtml variable contains the following xhtml:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" title=""  width="100"  height="100"  xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="8-165-o" xlink:title="Testflash"><param name="movie" value="&#47;MediaFile.axd&#63;Id&#61;165&#38;t&#61;091027133557"></param><param name="quality" value="high"></param><param name="bgcolor" value="#FFFFFF"></param><embed src="&#47;MediaFile.axd&#63;Id&#61;165&#38;t&#61;091027133557" quality="high" bgcolor="#FFFFFF" title=""  width="100"  height="100"  xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="8-165-o" xlink:title="Testflash" type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer"></embed></object>

The string that is passed to the pasteHtml method contains the following:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" title=""  width="100"  height="100"  xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="8-165-o" xlink:title="Testflash"><rade_param name="movie" value="&#47;MediaFile.axd&#63;Id&#61;165&#38;t&#61;091027133557"></rade_param><param name="movie" value="&#47;MediaFile.axd&#63;Id&#61;165&#38;t&#61;091027133557"></param><rade_param name="quality" value="high"></rade_param><param name="quality" value="high"></param><rade_param name="bgcolor" value="#FFFFFF"></rade_param><param name="bgcolor" value="#FFFFFF"></param><embed src="&#47;MediaFile.axd&#63;Id&#61;165&#38;t&#61;091027133557" quality="high" bgcolor="#FFFFFF" title=""  width="100"  height="100"  xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="8-165-o" xlink:title="Testflash" type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer"></embed></object>

After this html is pasted I switch to html mode where I see the following:
<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" height="100" width="100" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" xlink:title="Testflash" xlink:href="8-165-o" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" href="null">
<param name="movie" value="&#47;MediaFile.axd&#63;Id&#61;165&#38;t&#61;091027133557">
<param name="quality" value="high">
<param name="bgcolor" value="#FFFFFF"><embed src="&#47;MediaFile.axd&#63;Id&#61;165&#38;t&#61;091027133557" quality="high" bgcolor="#FFFFFF" title=""  width="100"  height="100"  xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="8-165-o" xlink:title="Testflash" type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer"></embed></object>

When I postback the page and access the RadEditor's Content property this contains the same (except that the order of some attributes is different).

I see several differences between the content I originally pasted and the content that is posted:
- the title="" attribute has been removed from the <object> element (not a big problem).
- a href="null" attribute has been added to the <object> element (not a big problem though I doubt that this is comform the xhtml specification).
- the <param> tags are no longer closed. This is a problem since the content is not valid xhtml anymore, and I cannot parse it with an xml parser (which I need to do).

How can I solve this issue? Thanks for any help!

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 30 Oct 2009, 03:42 PM
Hi Henk,

The param tags are not closed on purpose - this fixes a browser problem.
Our suggestion to fix the problem is to write a regular expression that closes the param tags on the server. The content returned by the RadEditor1.Content property is a string so you should modify it before submitting it to your XML parser.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Henk Huisman
Top achievements
Rank 1
answered on 03 Nov 2009, 07:49 AM
Thank you for your response. The solution you descibed is indeed what I have implemented, but I do think it is a bit weird that those tags are not closed when Telerik claims "Out of the box, RadEditor "Prometheus" will output XHTML compliant content (the content being edited) across all major browsers".

Are there more issues where the content is not valid xml? (So when tags are not closed, attributes are not quoted or whatever...?)
0
Rumen
Telerik team
answered on 05 Nov 2009, 02:16 PM
Hi Henk,

I tried to reproduce the reported problems with the latest Q3 2009 build of RadEditor, but without success. Please see the attached video and test the attached project. Are you able to reproduce the problem with the latest version?

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Henk Huisman
Top achievements
Rank 1
answered on 06 Nov 2009, 09:29 AM
Hi Rumen,

Thanks for your response. Indeed this version of the RadEditor seems to work fine. To replace the old Telerik.Web.UI with this new one will take me some time, which is no problem but before I do that I would like to know if I can use this new version.
When I log on to your website the latest version of "RadControls for ASP.NET AJAX" I can download is "2007.3 1425 (Feb 25, 2008)", so I am not sure if my license allows me to use the version you supplied. Could you clarify this for me? Does my license allow me to use this new version you supplied?
0
Rumen
Telerik team
answered on 11 Nov 2009, 12:26 PM
Hi Henk,

I checked our records and found that you have a license of RadControls for ASP.NET AJAX without subscriptions. This means that you are not entitled for free upgrades and updates.

My recommendation is to contact out sales team at http://www.telerik.com/purchase/contact-sales.aspx and ask my colleagues for discount so that you can purchase and download the latest registered version of the RadControls for ASP.NET AJAX, where the discussed problem is fixed.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Henk Huisman
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Henk Huisman
Top achievements
Rank 1
Share this question
or