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 "’"
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?
Copy link to clipboard
Copied
Plz try ...
<cfset basePath = "fckeditor/">
<cfset testString="This is a test name
& d‘zouza ">
<cfscript>
fckEditor = createObject("component", "#basePath#fckeditor");
Copy link to clipboard
Copied
Do the replace before the parse.
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, "’", "'", "ALL")>
Then I use the cleanedupapost variable to fill the text editor. Works, but the apostrophes still don't show up.
Copy link to clipboard
Copied
OK, now I see that while the original html file has apostrophes in it (using "’"), 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?