[Twisted-Python] Sending domish.Element results to Unpersistable

twisted-web at udmvt.ru twisted-web at udmvt.ru
Mon Dec 28 02:47:06 MST 2009


On Mon, Dec 28, 2009 at 10:14:49AM +0800, Enrique Samson Jr. wrote:
> Hi,
> 
> I'm using PB to to send copies of domish.Element instances to another
> application. I just don't want to parse XML again and thought it would
> be better to send Element copies and save parsing on the other end. But
> receiving application just gets an Unpersistable.
> 
> I'm considering reducing the Element instances to dicts but I may leave
> out details I may need in the future.
> 
> Am I missing something?
Perhaps I missed something, but IMHO the desire of sending parsed XML to another
process just indicates some misdesign in the whole system ...
PB allows you to build perfect machine-machine interface and unless you really need
to pass XML chunks from outhere to your another process, never try to send around XML.
If you have your data structures coming from XML - parse them and put into native python
structures, they are so pretty and highlevel. By the way, SAX parser will help you better than DOM.

If you have just an abstract XML - send it as unicode strings, don't parse it at all!
If you store your program's data in XML DOM tree - you are most probably just abusing
the whole idea of XML. Just think, what if you will need to change the XML parser
(for perfomance or any other reason)?


Alexey
> 
> 
> Enrique
> 
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

-- 
с уважением,
Алексей Шпагин
системный администратор
цеха передачи данных
технического центра телекоммуникаций
ОАО "ВолгаТелеком" 
филиал в Удмуртской республике.




More information about the Twisted-Python mailing list