Commit 0471daf
committed
Fix duplicate responses in XPath following, following-sibling, preceding, preceding-sibling
## Why?
See: #251 (comment)
- XPath : a/d/preceding::* => ["d", "c", "b"]
```xml
<a>
<b/> <!-- a/d/preceding::b -->
<c/> <!-- a/d/preceding::c -->
<d/> <!-- a/d/preceding::d -->
<d/> <!-- self -->
<e/>
<f/>
</a>
```
- XPath : a/d/following::* => ["d", "e", "f"]
```xml
<a>
<b/>
<c/>
<d/> <!-- self -->
<d/> <!-- a/d/following::d -->
<e/> <!-- a/d/following::e -->
<f/> <!-- a/d/following::f -->
</a>
```
- XPath : a/b/x/following-sibling:* => ["c", "d", "e"]
```xml
<a>
<b>
<x/> <!-- self -->
<c/> <!-- a/b/x/following-sibling::c -->
<d/> <!-- a/b/x/following-sibling::d -->
</b>
<b>
<x/> <!-- self -->
<e/> <!-- a/b/x/following-sibling::e -->
</b>
</a>
```
- XPath : a/b/x/following-sibling:* => ["c", "d", "x", "e"]
```xml
<a>
<b>
<x/> <!-- self -->
<c/> <!-- a/b/x/following-sibling::c -->
<d/> <!-- a/b/x/following-sibling::d -->
<x/> <!-- a/b/x/following-sibling::x -->
<e/> <!-- a/b/x/following-sibling::e -->
</b>
</a>
```
- XPath : a/b/x/preceding-sibling::* => ["e", "d", "c"]
```xml
<a>
<b>
<c/> <!-- a/b/x/preceding-sibling::c -->
<d/> <!-- a/b/x/preceding-sibling::d -->
<x/> <!-- self -->
</b>
<b>
<e/> <!-- a/b/x/preceding-sibling::e -->
<x/> <!-- self -->
</b>
</a>
```
- XPath : a/b/x/preceding-sibling::* => ["e", "x", "d", "c"]
```xml
<a>
<b>
<c/> <!-- a/b/x/preceding-sibling::c -->
<d/> <!-- a/b/x/preceding-sibling::d -->
<x/> <!-- a/b/x/preceding-sibling::x -->
<e/> <!-- a/b/x/preceding-sibling::e -->
<x/> <!-- self -->
</b>
</a>
```
- XPath : //a/following-sibling:*[1] => ["w", "x", "y", "z"]
```xml
<div>
<div>
<a/> <-- self -->
<w/> <-- //a/following-sibling:*[1] -->
</div>
<a/> <-- self -->
<x/> <-- //a/following-sibling:*[1] -->
<a/> <-- self -->
<y/> <-- //a/following-sibling:*[1] -->
<a/> <-- self -->
<z/> <-- //a/following-sibling:*[1] -->
</div>
```1 parent de6f40e commit 0471daf
2 files changed
Lines changed: 95 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
420 | | - | |
421 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
422 | 500 | | |
423 | 501 | | |
424 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
425 | 516 | | |
426 | 517 | | |
427 | 518 | | |
| |||
0 commit comments