Link to home
Start Free TrialLog in
Avatar of adessell
adessell

asked on

trying to use tinymce with xslt.. Has anyone done this? I'm having problems

I currently have an xml file that references a stylesheet.  This stylesheet generates an html file based on the xml document that's referencing it.  What I want to do is make the xsl stylesheet display an editor that is initially populated with the data from the corresponding xml file.   The editor I'm trying to embed into my html is an open source tool called tinyMCE, which is downloadable from http://tinymce.moxiecode.com/download.php

Now, to test out my stylesheet, I open up the corresponding xml file from a web browser, currently using firefox.  For whatever reason, I'm getting "tinyMCE not defined in the xml file" error in my browser when opening the xml file.  Now there isn't any html code in the xml, the html code is generated within the corresponding spreadsheet..

So my xml file looks something like this
 <?xml-stylesheet type="text/xsl" href="mystylesheet.xsl"?>
    <elmt1> ... </elmnt1>
    :
   
My stylehseet looks like this
<xsl:stylesheet versino="1.0 xmlns="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" encoding="UTF-*" version="1.0" />
     <xsl:template match="elmnt1">
         <html>
        <head>
        <title>TinyMCE Test</title>
        <script language="javascript" type="text/javascript" src="file://C:/tinyMCE/jscripts/tiny_mce/tiny_mce.js"></script>
        <script language="javascript" type="text/javascript">
                tinyMCE.init((
                      mode : "textareas"
               ));
        </script>
        </head>
        <body>
        <form method="post">
             <textarea name="content" cols="50" rows="15">This is some content that will be editable by TinyMCE.
             </textarea>
        </form>
       </body>
       </html>
    </xsl:template>
</xsl:stylesheet>

Anybody have a clue?  If I pull the html above out of the xslt file and put it into a plain ole html file, it works fine.  But from the xsl file the browser just locks up.  The only way I know there are errors is because I am using firebugs.  Its telling me that the tinyMCE object is undefined.  

Any Clue?
ASKER CERTIFIED SOLUTION
Avatar of Craig Yellick
Craig Yellick
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@OP: note that the output encoding is set to "UTF-*". This is not a known encoding and might give problems. Try "UTF-8" or "UTF-16" instead (together with the changes of CraigYellick of course).
Avatar of adessell
adessell

ASKER

the xsl seems to work fine in IE.  It doesn't work in firefox.  Has anyone tried doing this in firefox?
More specifically in firefox the tinymce edit window pops up as a plain ole text box.  But it shouldn't be just a text box.  IT should be a text box with some edit buttons included, such as underline, italics, etc..  LIke a mini word perfect window.
That shouldn't have anything to do with the XML or the XSLT, provided you make sure that the output you generate is either run through a post-processor like Prototype or JScript (iirc) to run the javascript that is embedded in the result, or is run on the server.

To execute javascript that is a result of client side transformations you just need to go that little extra length. And these libraries have already done that for you.

If you also have problems with tinymce when you do not involve XML or XSLT, then you should try the solution offered on this page: http://community.contractwebdevelopment.com/firefox-wont-work-with-fckeditor-or-tinymce

-- Abel --