[Fedora-suds-list] Proposal to add .innerXML attribute to Object

Jesper Noehr jesper at noehr.org
Fri May 16 07:23:29 UTC 2008


Hello list,

As per discussion with kurazu on IRC this morning, and per http://msdn.microsoft.com/hi-in/library/ms440289(en-us).aspx 
  it seems necessary in some cases to allow for people to construct  
arbitrary content of nodes. The problem here being that the  
aforementioned API requires you to set XML as content for a value.  
Right now, suds will automatically escape the XML.

What I propose is to add a new "magic" attribute to Objects, called  
`innerXML` which would make an instance of `safestring` which is a  
subclass of unicode. This subclass would have a new attribute, `safe`  
and when the marshaller encounters the object to marshal, it will omit  
the escaping if this attribute is present (and True.)

You may also create instances of `safestring` anywhere else, and e.g.  
use it as the value of a property in something returned by get_instance.

I don't like it much either, but I think this the cleanest way of  
getting around it.


Jesper





More information about the suds mailing list