List Info

Thread: Re: PyXML for py 2.5




Re: PyXML for py 2.5
country flaguser name
Germany
2008-02-24 09:05:39
Hi,

Martin v. Löwis wrote:
> Implementation of specifications is another reason.
XSLT2, XPath2,
> XQuery?

There definitely isn't a "standard" solution, but
it's not true that there is
nothing, either.

http://w
ww.w3.org/XML/Query/#implementations

http://behnel.de/cgi-bin/weblog_basic/index.php?p=12


> 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.


> XML 1.1?

Honestly - what for?


> XML Encryption and Signature?

Should be easy to wrap libxmlsec if you need it.

http://www.aleksey.com
/xmlsec/


> XML Base?

Supported by libxml2.


> Catalogs?

Supported by libxml2.


> Sure, if your processing needs are simple, the Python
implementation
> will be simple, and perhaps also reasonably performant.
However,
> in an application that is all about XML processing,
chances are high
> that you need a functionality that is not available in
the XML library
> of your choice, but would be available in Java.

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.

Stefan

_______________________________________________
XML-SIG maillist  -  XML-SIGpython.org
http:
//mail.python.org/mailman/listinfo/xml-sig

Re: PyXML for py 2.5
user name
2008-02-24 12:28:40
>> 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

_______________________________________________
XML-SIG maillist  -  XML-SIGpython.org
http:
//mail.python.org/mailman/listinfo/xml-sig

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )