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 java 相同?例如
<root> <child1>value</child1> <child2>value2</child2> </root>
至
<newRoot> <child1>value</child1> <child2>value2</child2> </newRoot>
XPath 只能选择完整的子树,不能修改它们。如果你需要改变元素,要么
/root
rename node /root as 'newRoot'