如何在python中处理xml名称空间?

2024-09-28 05:18:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我不打算解析xml文件,但我想在python中移动它。(即etree) 我知道etree的基本概念,但我只想知道xml名称空间。 代码中有3个名称空间。这是我要传送的代码。你知道吗

<;?xml version=“1.0”encoding=“UTF-8”standalone=“是”?>;<;ns1:G2消息xmlns:ns1="http://www.gamingstandards.com/g2s/schemas/v1.0.3“>;<;ns1:g2sBody ns1:dateTimeSent=”2014-08-14T15:30:48.692+09:00“ns1:egmId=”TestAppEGMID“ns1:hostId=”1“>;ns1:通信ns1:deviceId=“0”ns1:sessionId=“1001”ns1:sessionType=“G2S\U请求”ns1:timeToLive=“100”ns1:commandId=“1001”ns1:dateTime=“2014-08-14T06:30:48.696Z”>;<;ns1:keepAlive/>;<;/ns1:communications>;<;/ns1:g2sBody>;<;/ns1:g2sMessage>;TestAppEGMID1

有人有主意吗?你知道吗


Tags: 文件代码ltgt名称version空间xml

热门问题