Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个要解析的 XML 文件,其中元素标签的格式为:
<mensa-1> .. </mensa-1> <mensa-2> .. </mensa-2>
当元素名称在末尾通过数字不同时,是否可以通过 Xpath 解析此类元素?
以下 XPath 表达式返回名称以“mensa-”开头的所有元素:
//*[starts-with(name(),'mensa-')]