• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

antchfx / xpath / 19214782526
78%
master: 78%

Build:
Build:
LAST BUILD BRANCH: fix-ancestor-predicate-chain
DEFAULT BRANCH: master
Ran 09 Nov 2025 09:34PM UTC
Jobs 1
Files 8
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Nov 2025 09:33PM UTC coverage: 78.01% (+0.03%) from 77.98%
19214782526

Pull #119

github

mislav
Fix chained predicates on ancestor axis

The XPath expression with chained predicates on the ancestor axis was not
working correctly. For example:
  //*[@itemprop="author"][ancestor::*[@itemscope][1][@itemtype="Comment"]]

This expression should find all elements with @itemprop="author" whose first
@itemscope ancestor has @itemtype="Comment". However, it was returning 0
results instead of the expected elements.

Root cause:
1. ancestorQuery.table (deduplication table) was persisting across Evaluate()
   calls, preventing ancestors from being found for subsequent input contexts.
2. filterQuery.positmap (position map) was not being reset during Evaluate(),
   causing position tracking to be incorrect when the same predicate query was
   reused for multiple input nodes.

Fix:
- Reset ancestorQuery.table to nil in Evaluate() to ensure clean state for
  each evaluation
- Reset filterQuery.positmap to nil in Evaluate() to ensure clean state for
  each evaluation

These changes ensure that when a predicate query is evaluated multiple times
(once for each candidate node), the internal state is properly reset, allowing
the query to work correctly for each evaluation.

💁 Unit test by Mislav
🤖 Implementation by [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Pull Request #119: Fix chained predicates on ancestor axis

4 of 4 new or added lines in 1 file covered. (100.0%)

2313 of 2965 relevant lines covered (78.01%)

232.11 hits per line

Jobs
ID Job ID Ran Files Coverage
1 19214782526.1 09 Nov 2025 09:34PM UTC 8
78.01
GitHub Action Run
Source Files on build 19214782526
  • Tree
  • List 8
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #119
  • PR Base - master (#17033624841)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc