-
Hi, I'm working on a SQLite extension that provides an <abc>
<def>
Hi
</def>
<def>
Bye
</def>
</abc> The xpath expression So, is this the expected behavior of Thanks, Tim |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Note that the general construction of the path may need to be somewhat domain-specific, for example if the path needs to survive document changes but elements have unique ids then it may be better to construct smth like |
Beta Was this translation helpful? Give feedback.
path()
predates XPath, and uses a simpler syntax that is compatible withfirst_element_by_path
- but it indeed doesn't work when the sibling name is not unique. It's not a bug, just a limitation of the format thatpath()
works with; maybe it's worth highlighting in the documentation / header comment, but otherwise it's by design.Note that the general construction of the path may need to be somewhat domain-specific, for example if the path needs to survive document changes but elements have unique ids then it may be better to construct smth like
/abc/def[@id = 'hi']
.