jjzjj

docToInclude

全部标签

python /迷你王国 : Iterate on a NodeList

我正在制作一个解析XML文件的Python程序。我需要遍历NodeList,但我在使用“fornodeinNodeList”语法时遇到了问题。这是一个代码示例:docToInclude=parse(node.getAttribute("file"))print("childNodecount:",len(docToInclude.documentElement.childNodes))print("childNodes:",docToInclude.documentElement.childNodes)print("")foriinrange(0,len(docToInclude.do