Avoid HTML entity encoding in Feed Export Description

Author Message

Thomas Parisot

Friday 03 June 2011 2:20:12 am

Hello everybody,

I export blog posts as RSS feed with eZ Publish and it works great.
However I encounter a subtle problem: I assed an XML Text attribute to the item description and eZ outputs it as encoded entities.

Wouldn't it better to wrap the description with CDATA + plain HTML? Or is there a way to make this working this way?

Thanks a lot :) 

Brandon Chambers

Friday 03 June 2011 9:35:33 am

Can you paste your result and what you're expecting? Also

 

Your right, HTML in XML is a no-no unless using the CDATA tag. This might be a bug?

http://www.w3schools.com/xml/xml_cdata.asp

Check out the bugs that have to do with RSS:

http://issues.ez.no/IssueList.php?Search=rss&SearchIn=3

 

Hope this helps!

Brandon Chambers
brandon@granitehorizon.com
blog: http://blog.divdesigns.com
Granite Horizon / http://granitehorizon.com

Thomas Parisot

Monday 06 June 2011 12:42:53 am

Thanks for your reply Brandon.

You can figure it out at: http://bordeaux-winetour.fr/rss/feed/blog

I'd like to have items descriptions as CDATA + plain HTML (rather than entity encoded) to ease the feed importing in other systems (like planet).

I would prefer to use the bundled feed rather than doing my own templates/module to achieve that simple goal.

Thanks for your help :)

Thomas Parisot

Wednesday 08 June 2011 4:10:38 am

I've found what caused trouble: it's related the way the feed is built.

By assigning HTML to a DomNode->nodeValue, it's entity encoded to fit in a string.
The only way I found was to create a documentFragment, assign the HTML with the asXML method and append the fragment to the DomNode.

No clean way to do that either ;-( 

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:06:57
Script start
Timing: Jan 18 2025 02:06:57
Module start 'layout'
Timing: Jan 18 2025 02:06:57
Module start 'content'
Timing: Jan 18 2025 02:06:57
Module end 'content'
Timing: Jan 18 2025 02:06:57
Script end

Main resources:

Total runtime0.8109 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 588.1563152.6563
Module start 'layout' 0.00690.0031 740.812539.5156
Module start 'content' 0.01010.7992 780.3281562.4063
Module end 'content' 0.80930.0015 1,342.734412.1094
Script end 0.8108  1,354.8438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3761160.0002
Check MTime0.00130.1554160.0001
Mysql Total
Database connection0.00080.093610.0008
Mysqli_queries0.753292.8925620.0121
Looping result0.00060.0679600.0000
Template Total0.779796.220.3898
Template load0.00160.199920.0008
Template processing0.778095.953820.3890
Template load and register function0.00010.012410.0001
states
state_id_array0.00110.140310.0011
state_identifier_array0.00170.213120.0009
Override
Cache load0.00140.1705350.0000
Sytem overhead
Fetch class attribute can translate value0.00090.110120.0004
Fetch class attribute name0.00100.124760.0002
XML
Image XML parsing0.00100.119420.0005
class_abstraction
Instantiating content class attribute0.00000.001980.0000
General
dbfile0.00080.1022220.0000
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs