【发布时间】:2010-06-06 15:04:50
【问题描述】:
我有xml格式:
<channel>
<games>
<game slot='1'>
<id>Bric A Bloc</id>
<title-text>BricABloc Hoorah</title-text>
<link>Fruit Splat</link>
</game>
</games>
</channel>
我已经使用 lxml.objectify 解析了这个 xml,通过:
tree = objectify.parse(file)
<games> 下可能会有多个 <game>s。
我知道我可以通过以下方式生成<game> 对象列表:
[ tree.games[0].game[0:4] ]
我的问题是,这些对象是什么类,是否有一个函数可以打印这些对象所属的任何类的任何对象?
【问题讨论】: