Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 2 of 2

Thread: HTML Special Characters / Output Escaping

  1. #1
    Upscale_Automotive is offline Senior Member
    Join Date
    Apr 2008
    Posts
    201

    Question HTML Special Characters / Output Escaping

    When uploading titles and descriptions and any other content via the WSI that includes special characters, I understand that you can add <![CDATA[]]> around the content in order to preserve it. My problem is that I have data/descriptions/titles that are already converted to HTML special characters and when uploaded via the WSI the result is a product with a title or description with HTML special characters all throughout (when TurnOffHtmlEditorInAdminSite is false) or title or description with literal HTML code all throughout (when TurnOffHtmlEditorInAdminSite is true). Is there a command within WSI that can convert the HTML special characters back to regular special characters that are suitable when using the <![CDATA[]]> notation?

    Example:
    Uploading the following works just fine.
    C#/VB.NET Code:
    <Description>
    <![
    CDATA[
    DESCRIPTION CONTENT
    <br>
    <
    br>
    <
    table>
        <
    tbody>
            <
    tr>
                <
    td>TABLE CONTENT</td>
                <
    td>TABLE CONTENT</td>
                <
    td>TABLE CONTENT</td>
                <
    td>TABLE CONTENT</td>
                <
    td>TABLE CONTENT</td>
            </
    tr>
            <
    tr>
                <
    td>TABLE CONTENT</td>
                <
    td>TABLE CONTENT</td>
                <
    td>TABLE CONTENT</td>
                <
    td>TABLE CONTENT</td>
                <
    td>TABLE CONTENT</td>
            </
    tr>
            <
    tr>
                <
    td>TABLE CONTENT</td>
                <
    td>TABLE CONTENT</td>
                <
    td>TABLE CONTENT</td>
                <
    td>TABLE CONTENT</td>
                <
    td>TABLE CONTENT</td>
            </
    tr>
        </
    tbody>
    </
    table>
    ]]>
    </
    Description
    But Uploading the following, regardless of the TurnOffHtmlEditorInAdminSite AppConfig setting or use of <![CDATA[]]>, results in the HTML formatting being lost.
    C#/VB.NET Code:
    <Description>
    DESCRIPTION CONTENT
    &lt;br&gt;
    &
    lt;br&gt;
    &
    lt;table&gt;
        &
    lt;tbody&gt;
            &
    lt;tr&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
            &
    lt;/tr&gt;
            &
    lt;tr&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
            &
    lt;/tr&gt;
            &
    lt;tr&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
                &
    lt;td&gt;TABLE CONTENT&lt;/td&gt;
            &
    lt;/tr&gt;
        &
    lt;/tbody&gt;
    &
    lt;/table&gt;</Description
    How can I take my information which is already in HTML special character format like the second example and upload it to properly display as HTML? Is there a line/command I can add to convert the HTML special characters back to regular special characters? Then I would just need the <![CDATA[]]> tags in there and it would work correctly I think.

    I hope this question makes sense.

  2. #2
    cdub is offline Junior Member
    Join Date
    Jan 2009
    Posts
    17

    Default

    The TurnOffHtmlEditorInAdminSite setting in this case should not matter as that is used just when editing from within the storefront's admin.

    You might want to query your live database directly to see what the contents of that is to make sure your HTML is not being encoded by whatever package you are using to upload or SOAP your results. The live database should have <> in it not &gt; and &lt;'s

    You might want to also check out the XML package you are using to display your product information. See if you have the disable-output-escaping="yes" set for the description/summary node, and try flipping that depending on how the data is encoded in the database.