【IT专家】如何使用python 2.7迭代xml项的多个子节点

本文由我司收集整编,推荐下载,如有疑问,请与我司联系如何使用python 2.7迭代xml项的多个子节点如何使用python 2.7迭代xml项的多个子节点[英]How to iterate through multiple child nodes of xml item using python 2.7 I’m trying to parse imperfectly structured XML data from the USPTO in the form of缝隙腐蚀
 我试图以美国专利商标局的形式解析不完美结构的XML数据河南网通宽带
266uu
 parent  child  child-text text child-text more text /child-text  child-text more text /child-text  /child-text  /child  /parent  I’m trying to capture all the text of the child-text nodes. But as you can see, the first child-text tag does not close until after all the remaining tags have finished. The following excerpt is an example:
石门一中苏光 我正在尝试捕获子文本节点的所有文本。但正如您所看到的,第一个子文本标记在所有剩余标记完成之后才会关闭。以下摘录是一个例子:
 claims id=“claims”  claim id=“CLM-00001” num=“00001”  claim-text 1. An all-solid-state electrochromic device comprising: claim-text a transparent base material; and /claim-text  claim-text an electrochromic multilayer-stack structure formed on the transparent base material, the electrochromic multilayer-stack structure comprising: claim-text a first transparent-conductive film; /claim-text  claim-text an ion-storage layer formed on the first transparent-conductive film; /claim-text  claim-text a solid-el
杜家台分洪ectrolyte layer formed on the ion-storage layer; and /claim-text  claim-text an electrochromic layer formed on the solid-electrolyte layer, the electrochromic layer comprising a reflection-controllable electrochromic layer comprising an antimony-based alloy comprising Sb sub x /sub CoLi sub y /sub in which 0.5 #x2266;x #x2266;10, and 0.1 #x2266;y #x2266;10. /claim-text  /claim-text  /claim-text  /claim  claim id=“CLM-00002” num=“00002”  claim-text 2. The all-solid-state electrochromic device according to claim-ref idref=“CLM-00001” claim 1 /claim-ref , wherein 3 #x2266;x #x2266;5 and 0.1 #x2266;y #x2266;3. /claim-text  /claim  /claims  My current approach is only capturing the content of the first tag and is not adequately capturing content of subelements (such as in the example
岛国文化

本文发布于:2024-09-21 23:24:00,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/569746.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:文本   我司   标记   使用
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议