[XML-SIG] PyXML for py 2.5

"Martin v. Löwis" martin at v.loewis.de
Sun Feb 24 19:28:40 CET 2008


>> Mapping of Schema definitions to Python classes?
> 
> A combination of lxml.objectify and schema validation is close enough to that,
> IMHO, but not a bit less powerful, as it's C-implemented and completely
> runtime configurable in Python code at basically any granularity.

So can you also use that to generate documents from scratch? Suppose I have

<element name="Person">
  <complexType>
    <sequence>
      <element name="first" type="string"/>
      <element name="last" type="string"/>
      <element name="age" type="integer"/>
</element>

then with lxml.objectify, how would I spell

   p = Person(first="Monika", last="Mustermann", age=57)
   p.toxml()

>> XML 1.1?
> 
> Honestly - what for?

To parse it, should you ever see documents that use it. In the language
for best XML processing, it's reasonably to expect that this
implemented, no? Xerces 2.9 for Java supports it.

>> XML Encryption and Signature?
> 
> Should be easy to wrap libxmlsec if you need it.
> 
> http://www.aleksey.com/xmlsec/

Perhaps. In Java, I get working implementations without further work.

> If you start with ElementTree and find that you need a feature that isn't
> supported there, chances are high that you will either find it in lxml or that
> it would be easy to add to it if you really feel like needing it.

So how about a web services stack :-?

Regards,
Martin



More information about the XML-SIG mailing list