我正在使用Python 2.7中的ElementTree构建一个SVG文档.这是代码:
from xml.etree import ElementTree as etree
root = etree.XML('<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>')
root.append(etree.Element("path"))
root[0].set("d", "M1 1 L2 2 Z")
print etree.tostring(root, encoding='iso-8859-1')
Run Code Online (Sandbox Code Playgroud)
这会生成输出:
<?xml version='1.0' encoding='iso-8859-1'?>
<ns0:svg xmlns:ns0="http://www.w3.org/2000/svg" height="100%" version="1.1" width="100%"><path d="M1 1 L2 2 Z" /></ns0:svg>
Run Code Online (Sandbox Code Playgroud)
这不会解析为有效的SVG.如何删除ns0名称空间?
我知道我可以使用 install_name_tool 的 -change 选项来更改存储在 dylib 中的依赖共享库的名称,但是有没有办法删除依赖共享库,我认为这是一个 LC_LOAD_DYLIB 命令,所以它不会当我在 dylib 上运行 otool -L 时不显示?