12 |
|
#include <menes-api/process.hpp> |
13 |
|
#include <menes-app/simple.hpp> |
14 |
|
#include <menes-ios/helpers.hpp> |
15 |
+ |
#include <menes-xml/document.hpp> |
16 |
+ |
#include <menes-xml/nodeset.hpp> |
17 |
+ |
#include <menes-xml/parse.hpp> |
18 |
|
|
19 |
|
class Bender |
20 |
|
{ |
84 |
|
|
85 |
|
void Bender::bend(const ext::String& path) |
86 |
|
{ |
87 |
< |
_L<ext::String> args(1, "-a"); |
87 |
> |
_H<xml::Document> document(xml::Parse("bender.xml")); |
88 |
> |
_H<xml::Node> node(*document/"bender"); |
89 |
> |
ext::String program(*node/"program"); |
90 |
> |
_L<ext::String> args; |
91 |
> |
|
92 |
> |
_foreach (const xml::NodeSet, arg, *node/"argument") args.InsertLast(**arg); |
93 |
|
|
94 |
|
args.InsertLast(path); |
95 |
|
|
96 |
< |
#if defined(__FreeBSD__) |
97 |
< |
_S<api::Process> xslt("/usr/local/bin/Xalan", args); |
90 |
< |
#elif defined(_WIN32) |
91 |
< |
_S<api::Process> xslt("Xalan.exe", args); |
92 |
< |
#else |
93 |
< |
_S<api::Process> xslt("Xalan", args); |
94 |
< |
#endif |
95 |
< |
ios::String output; |
96 |
> |
_S<api::Process> xslt(program, args); |
97 |
> |
_S<ios::String> output; |
98 |
|
|
99 |
|
ios::ReadToWrite(*xslt.GetReader(), output); |
100 |
|
|