作者:好宝贝蛋_282 | 来源:互联网 | 2023-05-19 14:24
AquestionabouttestingpropernestingofXMLtags:关于测试XML标记的正确嵌套的问题:Igotalistoftags,extra
A question about testing proper nesting of XML tags:
关于测试XML标记的正确嵌套的问题:
I got a list of tags, extracted from top to bottom from an xml file:
我得到了一个标签列表,从xml文件中从上到下提取:
- Closing tags are clearly indicated by forward slash
正斜杠清楚地表示关闭标签
- /to and /lastname tags are incorrectly nested. They should be switched. /lastname should be within to, /to parent tags.
/ to和/ lastname标记嵌套不正确。他们应该切换。 / lastname应位于to,/ to parent标签内。
tag_list = ['note', 'to', 'firstname', '/firstname', 'lastname', '/to', '/lastname', '/note']
tag_list = ['note','to','firstname','/ firstname','lastname','/ to','/ lastname','/ note']
What would be the code or direction to spot that /lastname tag is outside of its parent which is to, /to pair?
发现/ lastname标记在其父级之外的代码或方向是什么?
Cheers.
2 个解决方案