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文件。使用该函数效率很高,但我还想为每个找到的节点提取一些父属性。在节点集上应用时,我没有获得每个相关节点的相应父节点,而只是获得小于相关子节点集的相关父节点集,并且无法匹配它们。Rxml2xml_find_all()xml_find_all()
xml
R
xml2
xml_find_all()
当然,可以访问每个节点,然后通过 for 循环,寻找各自的父节点,但这会减慢整个过程。