Bug 1357971
| Summary: | libxml2 xpath differences between two versions | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Ali Akcaagac <aliakc> | ||||||
| Component: | libxml2 | Assignee: | Daniel Veillard <veillard> | ||||||
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
| Severity: | unspecified | Docs Contact: | |||||||
| Priority: | unspecified | ||||||||
| Version: | 24 | CC: | athmanem, c.david86, veillard, wellnhofer | ||||||
| Target Milestone: | --- | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2016-07-27 16:15:19 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
|
Description
Ali Akcaagac
2016-07-19 17:12:57 UTC
Created attachment 1181749 [details]
new version
All versions after that seem to be affected by this issue.
Ok saw that Fedora 22 received EOL today *darn* but the bug might be still valid one. Please test and fix. Will be updating to Fedora 24 in a couple of days anyways. I just tested this under Fedora 24 and the problem is there too. I had to recompile an old Fedora 22 Version for Fedora 24 to get the XPath correctly. It would be nice to have that one solved. Thanks. I was able to track the issue down to this:
-----------------------------------------
commit b4bcba23f64b71105514875f165a63d4cc720609
Author: Nick Wellnhofer <wellnhofer>
Date: Mon Aug 5 00:15:11 2013 +0200
Fix XPath '//' optimization with predicates
My attempt to optimize XPath expressions containing '//' caused a
regression reported in bug #695699. This commit disables the
optimization for expressions of the form '//foo[predicate]'.
-----------------------------------------
What I did:
1) I downloaded libxml2 from git (Upstream: HEAD)
2) I then retagged libxml2 to a certain commit (starting at 2.9.1)
3) I then grabbed one commit after another, recompiled, reinstalled and tested
The above optimization is the issue of xpath fails. Hope I was able to help and would like to see it fixed if possible.
The behavior of libxml2 2.9.2 is correct (and should also match the behavior of 2.9.0 and previous versions). The only broken version is 2.9.1. An expression of the form //title[1] should really return the first title child of every node containing titles. If you want the first title in the whole document, try (//title)[1]. Interesting! This means - if I understand it correctly - the correct way is that //title[1] returns not just the first element but also all first elements down the tree (of all the children and siblings that may follow). Thanks for the feedback then. I wondered and thought this to be a bug because one of my scripts failed to work (written around the 2.9.1 release date back in 2013). Will adopt your suggestion with (//tile)[1] then. Thanks for the feedback. This works... Thanks! Gonna close the report! |