Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Use lxml's adoptExternalDocument() #239

Copy link
Copy link
@scoder

Description

@scoder
Issue body actions

It seems that xmlsec's lxml integration does not call adoptExternalDocument() to create an lxml wrapper for an internally created libxml2 XML tree. If it wants to pass externally created XML documents into lxml, then it should call it. Simply wrapping an arbitrary libxml2 tree in an lxml Element violates lxml's tree invariants, such as shared usage of an XML name dict. This can lead to misbehaving elements, such as missing results from .find() (see https://bugs.launchpad.net/lxml/+bug/1960668).

https://github.com/lxml/lxml/blob/95f8006336889df154c45130db1ec897b424e529/src/lxml/includes/etreepublic.pxd#L64-L65

I admit that this is probably un(der)documented, so not your fault.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.