xpath 搜索名称以 Ball 结尾的节点

例子

XML

<College>

    <FootBall>

        <Members>20</Members>

        <Coach>Archie Theron</Coach>

        <Name>Wild cats</Name>

        <StarPlayer>David Perry</StarPlayer>

    </FootBall>

    <VolleyBall>

        <Members>24</Members>

        <Coach>Tim Jose</Coach>

        <Name>Avengers</Name>

        <StarPlayer>Lindsay Rowen</StarPlayer>

    </VolleyBall>

    <FoosBall>

        <Members>22</Members>

        <Coach>Rahul Mehra</Coach>

        <Name>Playerz</Name>

        <StarPlayer>Amanda Ren</StarPlayer>

    </FoosBall>

</College>

路径

/College/*[ends-with(local-name(),"Ball")]

要么

//*[ends-with(local-name(),"Ball")]

输出

<FootBall>

  <Members>20</Members>

  <Coach>Archie Theron</Coach>

  <Name>Wild cats</Name>

  <StarPlayer>David Perry</StarPlayer>

</FootBall>

<VolleyBall>

  <Members>24</Members>

  <Coach>Tim Jose</Coach>

  <Name>Avengers</Name>

  <StarPlayer>Lindsay Rowen</StarPlayer>

</VolleyBall>

<FoosBall>

  <Members>22</Members>

  <Coach>Rahul Mehra</Coach>

  <Name>Playerz</Name>

  <StarPlayer>Amanda Ren</StarPlayer>

</FoosBall>

           

以上是 xpath 搜索名称以 Ball 结尾的节点 的全部内容, 来源链接: utcz.com/z/343782.html

回到顶部