我所拥有的:<xliff:g>
xml 文件中带有标记的行,例如:
<string name="AAAAAAA" msgid="XXXXXXX">"Activity <xliff:g id="BBBBBBB">%1$s</xliff:g> isn\'t responding."\n\n"Do you want to close it?"</string>
我需要什么:读取整个字符串与以下内容相同:
Activity %1$s isn't responding.\n\nDo you want to close it?
你能帮忙吗?
我尝试使用 xml.dom.minidom。
dom = xml.dom.minidom.parse(xmlfile)
strings = dom.getElementsByTagName('string')
for string in strings:
rText = string.childNodes[0].nodeValue
print(rText)
结果是“活动