You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by mi...@apache.org on 2005/04/06 11:15:08 UTC

svn commit: r160270 - lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/asset.xsl

Author: michi
Date: Wed Apr  6 02:15:08 2005
New Revision: 160270

URL: http://svn.apache.org/viewcvs?view=rev&rev=160270
Log:
thanks to Simon Litwan the title of an asset is being transformed into well-formed XML if inserted through BXE

Modified:
    lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/asset.xsl

Modified: lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/asset.xsl
URL: http://svn.apache.org/viewcvs/lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/asset.xsl?view=diff&r1=160269&r2=160270
==============================================================================
--- lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/asset.xsl (original)
+++ lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/asset.xsl Wed Apr  6 02:15:08 2005
@@ -39,8 +39,14 @@
   <script>
     var ext = '<xsl:value-of select="$extensions"/>';
 
+
     function insertAsset(src, size, title) {    
       <![CDATA[
+      <!--change < and & to entities-->
+	  title = title.replace(/&amp;/g, "&");          
+	  title = title.replace(/&/g, "&amp;");
+	  title = title.replace(/&lt;/g, "<");          
+	  title = title.replace(/</g, "&lt;");       
       window.opener.bxe_insertContent('<asset xmlns="http://apache.org/cocoon/lenya/page-envelope/1.0" src="'+src+'" size="'+size+'" type="">'+title+'</asset>',window.opener.BXE_SELECTION,window.opener.BXE_SPLIT_IF_INLINE);
       ]]>
       window.close();



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org