我正在使用 python minidom 来解析 xml,但无法使其适用于以下 xml。我想选择第一个服务器标签并想要 name 标签的值,在本例中为“Server1”
<class>
<name>MyClass</name>
<security>
<name>MyClass</name>
</security>
<server>
<name>Server1</name>
<ssl>
<name>Server1</name>
</ssl>
<server-info>
<name>Server1</name>
</server-info>
</server>
<server>
<name>Server2</name>
<ssl>
<name>Server2</name>
</ssl>
<server-info>
<name>Server2</name>
</server-info>
</server>
<server>
<name>Server3</name>
<ssl>
<name>Server3</name>
</ssl>
<server-info>
<name>Server3</name>
</server-info>
</server>
</class>