Dr. Volker Jaenisch schrieb am 03.03.22 um 18:19:
Therefore I am currently working on enabling LXML to have <prefix>_<name> properties in objectify. The changes are not too complicated since the source code quality is good. I am hopeful that after the weekend I will have full functional prototype.

As Holger wrote, the issue with prefixes is that they are provided by the input document. There are well-known prefixes for a hand full of namespaces, but that is a pure naming convention and in no way an obligation.

While I can see that it might be helpful for debugging purposes to see that there are attributes like "html_image", no-one keeps them from ending up as "s_image" or just "image" (with a default namespace and no prefix), if the creator of the specific document at hand decides so.

Aside from debugging, I fail to see a use case for this. And it increases the risk for innocent users to write code that seems to work with most documents (that use "standard" prefixes) but fail for others (which tend to be missing from the test suite).

So … I think keeping prefixes generally out of the interface is a good decision.

Stefan
_______________________________________________
lxml - The Python XML Toolkit mailing list -- lxml@python.org
To unsubscribe send an email to lxml-le...@python.org
https://mail.python.org/mailman3/lists/lxml.python.org/
Member address: arch...@mail-archive.com

Reply via email to