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.
如何在不考虑命名空间和前缀的情况下使用 XPath 选择 XML
试过了
/*:OrderPerson/OrderUser/
但返回错误
org.jdom.JDOMException: Invalid XPath expression: .... Unexpected ':'
你可以试试这个表达
/*[local-name()='OrderPerson']/OrderUser/
您的 xpath 查询没有有效的语法尝试使用 /OrderPerson/OrderUser/*