xpath获取全部的child nodes without parent
Xml – XPath to get all child nodes (elements, comments, and text) without parent
Best Solution
child::* selects all element children of the context node
child::text() selects all text node children of the context node
child::node() selects all the children of the context node, whatever their node type
So I guess your answer is:
$doc/PRESENTEDIN/X/child::node()
And if you want a flatten array of all nested nodes:
$doc/PRESENTEDIN/X/descendant::node()
https://itecnote.com/tecnote/xml-xpath-to-get-all-child-nodes-elements-comments-and-text-without-parent/
阅读量: 637
发布于:
修改于:
发布于:
修改于: