On Thursday 02 August 2007 10:40:22 James Tauber wrote: > Another possibility would be, as I currently do for XHTML content, > just expect the raw XML to be passed in. e.g.: > > def item_extension_elements(self, item): > return """ > <g:shipping> > <g:country> US </g:country> > <g:service> By monkey </g:service> > <g:price> 20 EUR </g:price> > </g:shipping> > """" > > The biggest risk with that approach is that it's easy to make the > entire feed malformed by making a mistake here. > > Thoughts?
1) Even if you can guarantee wellformed-ness, you can't guarantee validity. If people are embedding serious amounts of XML here, one could argue that they should have separate tests for validity, which would catch malformed feeds anyway. 2) We can't predict how people are going to be generating these bits of XML -- for this type of thing, it might be in a separate library. 3) Even if it's not in a separate library, people may already have their own way of generating this stuff (e.g. something like nevow's 'stan') -- we don't want to force people away from that, and we don't want to have to reinvent that kind of thing. So just accepting strings seems a good idea to me. Luke -- Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law. Luke Plant || http://lukeplant.me.uk/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
