looked into php DOM and yes, thats a good idea but i wanted to avoid
handweaving of the feed.
also, i actually have a whole bunch of stuff in the namespace not just one(i
need mrss and some of my own namespace in the feed)
as of now ive added thos fields to the ZFBuilderEntry (like addThumbnail
etc.) and in the ZFRss am adding them to the DOM  in _mapFeedEntries() by
registering the namespace and inserting a node with createElementNS().
only prob being that i get an entry like:
<xfoo:test xmlns:xfoo="http://www.example.com/XFoo";>This is the root
element!</xfoo:test>
whereas i wouldve liked
<xfoo:test>This is the root element!</xfoo:test>
though i will strip away the xmlns:".." i wish i couldve avoided it as i
have registered the namespcae already.

this approach allows me to continue using importArray(), have some child
namespace nodes(by adding them in an array) and also make some of my nodes
mandatory etc so they can follow the specs.i really wish there was a more
elegant way to do this but i tink i'll have to live with this for the time
being.

any tips on making this better?


Pádraic Brady wrote:
> 
> That pretty much what I am suggesting - let Zend_Feed work away, then grab
> the DOM, then append your thumbnail elements using the DOM *NS methods. If
> it's just the one element you're adding, it would only take a few lines of
> code.
> 
>  Pádraic Brady
> 
> http://blog.astrumfutura.com
> http://www.survivethedeepend.com
> OpenID Europe Foundation Irish Representative
> 
> 
> 
> 
> 
> ________________________________
> From: Gautam Arora <[email protected]>
> To: [email protected]
> Sent: Saturday, August 8, 2009 12:33:15 AM
> Subject: Re: [fw-general] Creating Zend_Feed with custom namespace
> 
> 
> are you recommending I create the feed first and then intercept DOM to
> inject
> the namespaces? because how would i add a thumbnail in the entry in the
> first place as importArray() does not allow me to extend the syntax of the
> feed.
> I want to add a media:thumbnail to every entry of the rss feed.
> The closest I've come to is make changes in the Zend_Feed and associated
> classes themselves to add a new thumbnail field and am trying to add
> namespace to it now to make this a media:thumbnail, though i would prefer
> not to make changes to the framework itself.
> 
> are there other parts in ZFR i can look for ideas? or other things i could
> try?
> 
> 
> 
> Pádraic Brady wrote:
>> 
>> Depending on the type of module you need the new namespace for ( I think
>> MRSS isn't all that huge) I'd just intercept the DOM and do it manually.
>> You can access the DOM from Zend_Feed with a little persuasion, even if
>> it's not documented as a feature. ZFR's importFeed() method does this.
>> 
>>  Pádraic Brady
>> 
>> http://blog.astrumfutura.com
>> http://www.survivethedeepend.com
>> OpenID Europe Foundation Irish Representative
>> 
>> 
>> 
>> 
>> 
>> ________________________________
>> From: Gautam Arora <[email protected]>
>> To: [email protected]
>> Sent: Thursday, August 6, 2009 2:28:55 AM
>> Subject: Re: [fw-general] Creating Zend_Feed with custom namespace
>> 
>> 
>> @Paddy
>> Zend_Feed_Writer will be great. Looking forward to it.
>> 
>> In the meanwhile, can anyone recommend the best way to create a rss zend
>> feed with custom namespaces? I'm sure there must be a way around using
>> custom builders or ability to append entries (just that I havent come
>> across
>> it as yet :) )
>> 
>> Thanks!
>> 
>> 
>> Pádraic Brady wrote:
>>> 
>>> I can't speak for Zend_Feed itself, but in terms of the future I have
>>> proposed Zend_Feed_Writer to the wiki for comment following in the
>>> footsteps of Zend_Feed_Reader. It's not operational to the point of
>>> handling custom namespaces, though the plan is to allow users write
>>> Extensions for any Atom/RSS modules they wish (and support many at
>>> release
>>> date). So it is planned - unfortunately not implemented just yet. I am
>>> hoping to get it into ZF 1.10 once I have time in the next few weeks to
>>> build it up some more and request the Zend review.
>>> 
>>> Paddy
>>> 
>>>  Pádraic Brady
>>> 
>>> http://blog.astrumfutura.com
>>> http://www.survivethedeepend.com
>>> OpenID Europe Foundation Irish Representative
>>> 
>>> 
>>> 
>>> 
>>> 
>>> ________________________________
>>> From: Gautam Arora <[email protected]>
>>> To: [email protected]
>>> Sent: Thursday, August 6, 2009 12:03:34 AM
>>> Subject: [fw-general] Creating Zend_Feed with custom namespace
>>> 
>>> 
>>> I've created a zend rss feed using importArray() but now need to add
>>> some
>>> custom namespaces (e.g. for media mrss). Their is no support for custom
>>> namespaces in importArray() method and only single Zend_Feed_Rss_Entry
>>> can
>>> be created with custom namespace (they cant be appended together to form
>>> a
>>> complete rss)
>>> These issues have been raised earlier by other members as well.
>>> http://www.nabble.com/Producing-Google-Base-atom-feeds-td20488222.html#a20488222
>>> http://www.nabble.com/Beyond-Zend_Feed--td23376966.html#a23376966
>>> 
>>> are there any workarounds or alternatives to use custom namespaces with
>>> zend_feed? Is support being planned for it as it is an important
>>> feature.
>>> 
>>> Thanks
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/Creating-Zend_Feed-with-custom-namespace-tp24837727p24837727.html
>>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>> 
>>> -----
>>> Pádraic Brady
>>> 
>>> Blog: http://blog.astrumfutura.com
>>> Free Zend Framework Book: http://www.survivethedeepend.com
>>> OpenID Europe Foundation - Irish Representative
>>> 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Creating-Zend_Feed-with-custom-namespace-tp24837727p24838961.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>> 
>> -----
>> Pádraic Brady
>> 
>> Blog: http://blog.astrumfutura.com
>> Free Zend Framework Book: http://www.survivethedeepend.com
>> OpenID Europe Foundation - Irish Representative
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Creating-Zend_Feed-with-custom-namespace-tp24837727p24873427.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 
> -----
> Pádraic Brady
> 
> Blog: http://blog.astrumfutura.com
> Free Zend Framework Book: http://www.survivethedeepend.com
> OpenID Europe Foundation - Irish Representative
> 

-- 
View this message in context: 
http://www.nabble.com/Creating-Zend_Feed-with-custom-namespace-tp24837727p24881781.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to