我正在做一项任务,同时学习使用Python2.7和XalanXSLT处理器编程。你知道吗
代码:
import wx, os
from subprocess import call
def OnImport(self, event):
if self.Controler is not None and not self.CheckSaveBeforeClosing():
return
filepath = ""
if self.Controler is not None:
filepath = self.Controler.GetFilePath()
if filepath != "":
directory = os.path.dirname(filepath)
else:
directory = os.getcwd()
#Choose Source File
dialogIn = wx.FileDialog(self, _("Choose a model file"), directory, "", _("model files (*.xml)|*.xml|All files|*.*"), wx.OPEN)
if dialogIn.ShowModal() == wx.ID_OK:
filepath = dialogIn.GetPath()
else:
return
dialogIn.Destroy()
#Choose Out XML Directory
dirpath = ""
dialogOut = wx.DirDialog (self,"Choose Out XML Directory","",wx.OPEN)
if dialogOut.ShowModal () == wx.ID_OK:
dirpath = dialogOut.GetPath ()
filepathplc = dirpath + "\plc.xml"
# calling xalan via cmd
call (['java', '-classpath', '"xalan.jar";"serializer.jar"', 'org.apache.xalan.xslt.Process', '-in', filepath, '-xsl', 'C:\Users\User\Desktop\XSL_Folder\debproj3.xsl', '-out', filepathplc, '/n'])
else:
return
dialogOut.Destroy ()
我想用xalan xslt处理器和调用xalan部分来做xslt,但是什么也没有得到。我想用cmd写这个命令:
java -classpath "xalan.jar";"serializer.jar" org.apache.xalan.xslt.Process -in "source directory file" -xsl "xsl directory file" -out "output target directory file"
目前没有回答
相关问题 更多 >
编程相关推荐