ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

xml encode and character entities not working

July 15, 2010 12:17pm

Subscribe [2]
  • #1 / Jul 15, 2010 12:17pm

    Matt Harris

    95 posts

    deep breath…

    We have an issue we’re coming up against with exporting XML out of EE and importing that XML into Flash.

    In particular we have a field in one of our channels that we need to export HTML and for Flash to then read that HTML (for images, links etc.)

    Now if we use {exp:xml_encode} around that field then the field exports into the XML fine BUT it strips out the HTML…If we don’t have that tag around the field then the Flash just won’t run (because it breaks on the specific HTML characters ” , > <”  etc. ). So what we’re trying to do is convert the tags which break into HTML entities, we’ve set that up in the channel posting preferences and ticked off the automatically turn urls and email addresses into links but it just doesn’t work.

    So in summary, using :

    long_desc=”{exp:xml_encode}{field_id_41}{/exp:xml_encode}”

    lets Flash run but it doesn’t bring in the HTML (it’s actually stripped out when we view the XML).

    whilst using :

    long_desc=”{field_id_41}”

    breaks Flash because it outputs the html as normal i.e not encoded with HTML entities ...

    Any ideas ????

  • #2 / Jul 15, 2010 7:03pm

    Brandon Jones

    5500 posts

    Hi Matt,

    Going to move this over to the CodeShare Corner as EE is working as expected in this case, and I think you’ll get more input over there.

    One (I think) easy approach is to enable PHP in this particular template and then htmlentities() the field, which should prep it for Flash.

  • #3 / Jul 16, 2010 4:35am

    Matt Harris

    95 posts

    okay how do I “htmlentities() ” the field ??

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases