我被赋予查找包含角色名称“ skywalker”的所有电影的任务。
</Subsidiary>
<Subsidiary id="Lucasfilms">
<Movie>
<Name lang="en">Star Wars: The Force Awakens</Name>
<Year>2015</Year>
<ScreenTime unit="minutes">135</ScreenTime>
<Cast>
<Role name="Han Solo" actor="HarrisonFord" />
<Role name="Rey" actor="DaisyRidley" />
<Role name="Kylo Ren" actor="AdamDriver" />
<Role name="Finn" actor="JohnBoyega" />
<Role name="Luke Skywalker" actor="MarkHamill" />
<Role name="Supreme Leader Snoke" actor="AndySerkis" />
<Role name="C-3PO" actor="AnthonyDaniels" />
<Role name="Poe Dameron" actor="OscarIsaac" />
<Role name="General Hux" actor="DomhnallGleeson" />
</Cast>
</Movie>
i've tried //Disney/Subsidiaries/Subsidiary/Movie/Cast [contains(./Role,
'Skywalker')] this does not work
我希望它返回给我其中包含天行者名字的电影的名字。
答案 0 :(得分:0)
使用
vec.push_back(std::move(v));
返回/Subsidiary/Movie[Cast/Role[contains(@name,'Skywalker')]]/Name
元素的Name
元素。