我有这个XML字符串:
xml = "<name>Married with Children</name>
<person age="20">Al Bundy</person>
<character age="20">Bud Bundy</character>
<character age="19">Marcy Darcy</character>
<person age="18">John Doe</person>"
我明白,如果我使用
xml.css("characters")
它会生成一个字符标记标题列表,类似于
[<character age="20">Bud Bundy</character>, <character age="19">Marcy Darcy</character>]
我只是想摆脱名称标签,所以我想:
[<person age="20">Al Bundy</person>,
<character age="20">Bud Bundy</character>,
<character age="19">Marcy Darcy</character>,
<person age="18">John Doe</person>]
有没有办法创建一个人物OR字符列表标记?