Hi, Atom has tree formats for text element content: text, html, xhtml.
"text" means that the content of the element should be displayed as it is, so if you write <summary type="text"><![CDATA[<em>test</em>]]></summary> then you see exactly that is in the summary. "html" means that the content of the element is processed like it is html with encoded entities. So, either of <summary type="html"><![CDATA[<em>test</em>]]></summary> and <summary type="html"><em<test</em></summary> are the same. "xhtml" means that the content of the entity is valid xhtml within <div xmlns="...">...</div> tag. See RFC 4287: 3.1.1.3. XHTML <summary type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> This is <b>XHTML</b> content. </div> </summary> So, CDATA does not help in this case because <summary type="xhtml"><![CDATA[<div></div>]]></summary> = <summary type="xhtml"><div<</div></summary> and it is incorrect format of the atom feed. Check the following feed: <feed xmlns="http://www.w3.org/2005/Atom"> <title type="xhtml"><![CDATA[<div xmlns="http://www.w3.org/1999/xhtml">Alex @ Net articles</div>]]></title> <updated>2006-07-20T20:07:00Z</updated> <author> <name>Alexander Netkachev</name> </author> <id>http://alexatnet.com/blog/2</id> </feed> using the http://validator.w3.org/feed/. It says that "Missing xhtml:div element" and "title claims to be inline, but may contain html: div". So, the very right way to add the XML is to use type="xhtml" but it is not possible with current Zend_Feed nor in <summary/> nor in <content/>. My Atom toolkit ( http://www.alexatnet.com/blog/2/2006/06/02/atom-syndication-framework) has not nice Api, but it supports XHTML content as follows: $entry = $feed->Add(new Ant_Atom_Entry()); $content = $entry->Add(Ant_Atom_Content::Inline( '<p><i>[Update: The Atom draft is finished.]</i></p>', Ant_Atom_PlainText::Xhtml)); $content->SetAttribute('xml:lang', 'en'); $content->SetAttribute('xml:base', 'http://diveintomark.org/'); Sincerely, -- Alexander http://www.alexatnet.com/ - Blog and CMS created with Zend Framework and Ajax. On 3/31/07, Olivier <[EMAIL PROTECTED]> wrote:
Hi, The content of the summary node is within a CDATA section so you can just use the standard Zend_Feed_Atom class can't you? 2007/3/30, Alexander Netkachev <[EMAIL PROTECTED]>: > Hi, > > Are there any plans to support XHTML atom content type like > <summary type="xhtml"><div xmlns="..."><...>...entry content > here...<...></div></summary> > ? > > I have my content in XHTML with all those <br/>, <input .../> etc and that > leaves me only three options for now: > 1. Extend Zend_Feed_Atom and change _mapFeedEntries() or use another method > for similar functionality. > 2. Produce a feed with invalid HTML (valid XHTML) in it. > 3. Adjust Atom DOMDocument before sending it. > > Either of them does not look very good. > Any other ideas? > > Thanks, > -- > Alexander > http://www.alexatnet.com/ - Blog and CMS created with Zend Framework and > Ajax. -- Olivier