6 #include <qmessagebox.h>
15 xsltprocessor="xsltproc";
17 dia=new ShowTextDialog;
20 XSLTProc::~XSLTProc ()
25 void XSLTProc::addStringParam (const QString & k, const QString &v)
27 stringParamKey.append (k);
28 stringParamVal.append (v);
31 void XSLTProc::setOutputFile (const QString &s)
36 void XSLTProc::setXSLFile(const QString &s)
41 void XSLTProc::setInputFile (const QString &s)
46 void XSLTProc::addOutput (const QString &s)
51 void XSLTProc::process()
55 Process *xsltProc=new Process ();
57 QStringList::Iterator itk;
58 QStringList::Iterator itv=stringParamVal.begin();
60 for ( itk = stringParamKey.begin(); itk != stringParamKey.end(); ++itk )
62 args << "--stringparam";
72 QString com=xsltprocessor+" "+args.join(" ");
73 if (debug) cout <<"xsltproc executing:\n"<<qPrintable(com)<<endl;
74 dia.append ("vym is executing: \n" + com );
75 xsltProc->start(xsltprocessor,args);
76 if (!xsltProc->waitForStarted() )
78 QMessageBox::critical( 0, QObject::tr( "Critical Error" ),
79 QObject::tr("Could not start %1").arg(xsltprocessor) );
82 if (!xsltProc->waitForFinished())
84 QMessageBox::critical( 0, QObject::tr( "Critical Error" ),
85 QObject::tr("%1 didn't exit normally").arg(xsltprocessor) +
86 xsltProc->getErrout() );
87 if (xsltProc->exitStatus()>0) showOutput=true;
92 dia.append (xsltProc->getErrout());
93 dia.append (xsltProc->getStdout());
95 if (showOutput) dia.exec();