sissaschool / elementpath

XPath 1.0/2.0/3.0/3.1 parsers and selectors for ElementTree and lxml
MIT License
72 stars 20 forks source link

Error with "every ...in... satisfies..." #46

Closed RabbitJackTrade closed 2 years ago

RabbitJackTrade commented 2 years ago

Running the xml and code in this Stack Overflow question through the most recent version of elementpath results in both folder elements being selected, while the actual answer should be only the first folder.

brunato commented 2 years ago

Hi, it's related with the path step operator that fails to select /visits/doctor/@id attributes because the position is on patient. I will produce a patch for this after some checks.

Root selection was always problematic bacause the document position is managed with a None when context.root is an Element instead of an ElementTree instance. I have to decide to maintain this solution or if to wrap Element root into a new ElementTree instance at context initialization, maybe using an option.

brunato commented 2 years ago

Fix available with v2.5.3.