
Hi,
Stefan Behnel behnel_ml@gkec.informatik.tu-darmstadt.de schrieb am 22.06.2006 12:57:22:
Hi Holger,
Holger Joukl wrote:
I'd like to add an (arguably :-) "even-more-pythonic" API layer on top of lxml, enabling the dot (.) operator syntax to navigate through the tree, similar to amara or gnosis.xml.objectify, plus the possibility to assign simple Python builtin types transparently. [...]
I am now wondering how to implement such an API-layer a bit more non-intrusively, without changing the lxml base classes themselves.
Have a look here, that should get you going: http://codespeak.net/lxml/namespace_extensions.html
Thanks! Simply overlooked that part of the documentation. Can I get this mechanism to always return custom elements regardless of the namespace, without having to register the custom element class for every possible namespace?
I guess some ns-uri wildcard would have to be introduced ('*' ?) and the custom element registered for the wildcard, with an additional check for a wildcard registry in _find_element_class. Right?
Thanks for the quick response btw.
Cheers, H.
Der Inhalt dieser E-Mail ist vertraulich. Falls Sie nicht der angegebene Empfänger sind oder falls diese E-Mail irrtümlich an Sie adressiert wurde, verständigen Sie bitte den Absender sofort und löschen Sie die E-Mail sodann. Das unerlaubte Kopieren sowie die unbefugte Übermittlung sind nicht gestattet. Die Sicherheit von Übermittlungen per E-Mail kann nicht garantiert werden. Falls Sie eine Bestätigung wünschen, fordern Sie bitte den Inhalt der E-Mail als Hardcopy an.
The contents of this e-mail are confidential. If you are not the named addressee or if this transmission has been addressed to you in error, please notify the sender immediately and then delete this e-mail. Any unauthorized copying and transmission is forbidden. E-Mail transmission cannot be guaranteed to be secure. If verification is required, please request a hard copy version.