I have this XML:
<movies>
<movie>
<title>A History of Violence</title>
</movie>
<movie>
<title>Heat</title>
</movie>
</movies>
And I want to get first movie but saying that bring me the movie that is before Heat
.
A good use case for preceding
:
//movie/title[. = "Heat"]/preceding::movie
Or, preceding-sibling
:
//movie[title = "Heat"]/preceding-sibling::movie
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加