5 |
|
// $Id$ |
6 |
|
|
7 |
|
#include "Bender.hpp" |
8 |
< |
#include "Matcher.hpp" |
8 |
> |
#include "Matcher/Matcher.hpp" |
9 |
|
|
10 |
|
#include <menes-api/exename.hpp> |
11 |
|
#include <menes-api/files.hpp> |
91 |
|
|
92 |
|
void Bender::bend(const ext::String& path) |
93 |
|
{ |
94 |
< |
_L<ext::String> args(1, "-IN"); |
94 |
> |
_L<ext::String> args(1, "-a"); |
95 |
|
|
96 |
|
args.InsertLast(path); |
97 |
|
|
98 |
< |
_S<api::Process> xslt("/usr/local/bin/xalan-j", args); |
98 |
> |
#if defined(__FreeBSD__) |
99 |
> |
_S<api::Process> xslt("/usr/local/bin/Xalan", args); |
100 |
> |
#elif defined(_WIN32) |
101 |
> |
_S<api::Process> xslt("Xalan.exe", args); |
102 |
> |
#else |
103 |
> |
_S<api::Process> xslt("Xalan", args); |
104 |
> |
#endif |
105 |
|
ios::String output; |
106 |
|
|
107 |
|
ios::ReadToWrite(*xslt.GetReader(), output); |
109 |
|
if (!output.IsEmpty()) |
110 |
|
{ |
111 |
|
ext::String type("text/xml"); |
112 |
< |
Matcher matcher("http-equiv=\"Content-Type\" content=\"(.*)\""); |
112 |
> |
Matcher matcher("http-equiv=\"Content-Type\" content=\"(.*)\"", PCRE_MULTILINE); |
113 |
|
|
114 |
|
if (matcher == output) type = matcher[1]; |
115 |
|
|