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:
<parentNode name="Any Name"> <childNode>50</childNode> </parentNode>
我想检查一下,如果“childNode”的内容是“50”,那么在 XPath 的帮助下显示名称“Any Name”。请告诉我我该怎么做?
如果调用的元素是 50 ,那么路径/parentNode[childNode = 50]/@name选择调用的属性。namechildNode
/parentNode[childNode = 50]/@name
name
childNode