• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

fckeditor and apostrophes

Explorer ,
Dec 06, 2010 Dec 06, 2010

Copy link to clipboard

Copied

I've got a system where a user uploads an html file, and then the contents of the file is extracted using an xmlparse:

<cfscript>

    myxmldoc1 = XmlParse("D:\inetpub\mywebsite\editorial\#whichsection#\#Uploaded_Folder_Name#\#htmlFileName#");

    selectedElements = XmlSearch(GetTheTitle, "/html/body/h1");

    s = "";

    for (i = 1; i LTE ArrayLen(selectedElements); i = i + 1)

        s &= selectedElements.XmlText;

</cfscript>

The result of the xmlparse is shown in the FCKeditor. Works just fine, except my apostrophes aren't showing up. In the original html file, apostrophes are represented as "&rsquo;"

I know right after the parse I can do a Replace or REreplace, but I tried that and it made absolutely no difference. Any ideas?

Views

885

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 06, 2010 Dec 06, 2010

Copy link to clipboard

Copied

Plz try ...

<cfset basePath = "fckeditor/">


<cfset testString="This is a test name


        & d&lsquo;zouza ">


<cfscript>



fckEditor = createObject("component", "#basePath#fckeditor");


fckEditor.instanceName = "myEditor";


fckEditor.value   = '#testString#';


fckEditor.basePath  = basePath;


fckEditor.width   = "100%";


fckEditor.height  = 450;



fckEditor.create(); // create the editor.


</cfscript>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 07, 2010 Dec 07, 2010

Copy link to clipboard

Copied

Do the replace before the parse.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 07, 2010 Dec 07, 2010

Copy link to clipboard

Copied

Thanks Dan. Makes total sense, but my implementation must be wrong:

<cfscript>

    myxmldoc1 = XmlParse("D:\mywebsite\editorial\#whichsection#\#Uploaded_Folder_Name#\#htmlFileName#");

    selectedElements = XmlSearch(GetTheTitle, "/html/body/h1");

    s = "";

    for (i = 1; i LTE ArrayLen(selectedElements); i = i + 1)

        s &= selectedElements.XmlText;

</cfscript>

<cfset cleanedupapost = Replace(myxmldoc1, "&rsquo;", "'", "ALL")>

Then I use the cleanedupapost variable to fill the text editor. Works, but the apostrophes still don't show up.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 07, 2010 Dec 07, 2010

Copy link to clipboard

Copied

LATEST

OK, now I see that while the original html file has apostrophes in it (using "&rsquo;"), even if I don't apply any Replace code, the apostrophe's don't show up. It looks like the xmlparsing is taking it out automatically. Is that normal?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation