在用于记事本的XML工具插件中编写XSL转换的脚本输入++

2024-09-29 23:23:56 发布

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

我正在使用Notepad++的Python脚本插件(http://npppythonscript.sourceforge.net)对XML文件执行一些自动化任务。我已经能够在我编写的脚本中使用XML工具插件中的XSL转换函数,但只是为了显示弹出窗口,而不是输入.XSL文件的路径并启动转换。在

下面是我打开一个XML文件然后弹出XSL转换窗口的代码(在Python中,从Notepad++中的Python脚本运行):

notepad.open(xmlFilePath)
notepad.runMenuCommand("XML Tools", "XSL Transformations")
#I have a time.sleep(30) here so I can manually input the XSL file
notepad.saveAs(htmlFilePath)
notepad.close()

如何才能自动填充.xsl路径并模拟按按钮来启动转换?在


Tags: 文件工具函数代码路径脚本插件http

热门问题