你好,我正在制作一个程序,以导入一个SVG文件到我的文档。(升/毫升)
if so.funktion != "0":
if so.funktion=="1":
searchStr = '//svg:g[@svg-creator="popup1"]'
selectStr = template.xpath(searchStr, namespaces=inkex.NSS)
if selectStr != []:
selectStr[0].set("id","Popup "+so.name)
self.current_layer.append(selectStr[0])
else:
None
我的SVG文件:
^{pr2}$我可以更改和设置svg:g所以远了,但我需要访问/操纵另一个svg:g内部那个selectStr!在
如何访问和操作xpath的button1和button2? (我有多个具有相同属性的弹出窗口,因此我的实际xPath包含popup1)
您可以使用简单的XPath来查找子元素,例如,
selectStr
中的“button1”:或者使用
^{pr2}$xpath()
方法(如果您愿意):相关问题 更多 >
编程相关推荐