Commit 0716877
committed
fix: XPath following, following-sibling, preceding, preceding-sibling for multiple node
## 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>
```1 parent de6f40e commit 0716877
2 files changed
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| 300 | + | |
300 | 301 | | |
301 | 302 | | |
302 | 303 | | |
| |||
314 | 315 | | |
315 | 316 | | |
316 | 317 | | |
| 318 | + | |
317 | 319 | | |
318 | 320 | | |
319 | 321 | | |
| |||
331 | 333 | | |
332 | 334 | | |
333 | 335 | | |
| 336 | + | |
334 | 337 | | |
335 | 338 | | |
336 | 339 | | |
337 | 340 | | |
338 | 341 | | |
339 | 342 | | |
| 343 | + | |
340 | 344 | | |
341 | 345 | | |
342 | 346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
419 | 441 | | |
420 | 442 | | |
421 | 443 | | |
422 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
423 | 449 | | |
424 | 450 | | |
425 | 451 | | |
| |||
0 commit comments