logo
  • 教程列表
  • SO官方文檔
  • 查詢包含特定屬性的元素
    • 查詢具有特定屬性的所有元素
    • 查詢具有特定屬性值的所有元素
  1. StackOverflow 文件
  2. xpath 教程
  3. 查詢包含特定屬性的元素
  4. 查詢具有特定屬性的所有元素

查詢具有特定屬性的所有元素

Created: November-22, 2018

想象一下以下 XML:

-xml langCopy<root>
    <element foobar="hello_world" />
    <element example="this is one!" />
</root>
-xpath langCopy/root/element[@foobar]

並將返回 <element foobar="hello_world" /> 元素。

  • 查詢具有特定屬性值的所有元素
  • 查詢包含特定屬性的元素

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明