4 #include <qmessagebox.h>
11 xsltprocessor="xsltproc";
13 dia=new ShowTextDialog;
16 XSLTProc::~XSLTProc ()
21 void XSLTProc::addStringParam (const QString & k, const QString &v)
23 stringParamKey.append (k);
24 stringParamVal.append (v);
27 void XSLTProc::setOutputFile (const QString &s)
32 void XSLTProc::setXSLFile(const QString &s)
37 void XSLTProc::setInputFile (const QString &s)
42 void XSLTProc::addOutput (const QString &s)
47 void XSLTProc::process()
51 Process *xsltProc=new Process ();
53 QStringList::Iterator itk;
54 QStringList::Iterator itv=stringParamVal.begin();
56 for ( itk = stringParamKey.begin(); itk != stringParamKey.end(); ++itk )
58 args << "--stringparam";
68 QString com=xsltprocessor+" "+args.join(" ");
69 cout <<com.ascii()<<endl;
70 dia.append ("vym is executing: \n" + com );
71 xsltProc->start(xsltprocessor,args);
72 if (!xsltProc->waitForStarted() )
74 QMessageBox::critical( 0, QObject::tr( "Critical Error" ),
75 QObject::tr("Could not start %1").arg(xsltprocessor) );
78 if (!xsltProc->waitForFinished())
79 QMessageBox::critical( 0, QObject::tr( "Critical Error" ),
80 QObject::tr("%1 didn't exit normally").arg(xsltprocessor) +
81 xsltProc->getErrout() );
83 if (xsltProc->exitStatus()>0) showOutput=true;
87 dia.append (xsltProc->getErrout());
88 dia.append (xsltProc->getStdout());
90 if (showOutput) dia.exec();