summaryrefslogtreecommitdiff
path: root/src/render_xml.cc
blob: a213387ca69fb9bffc657d19ed22836dba4e3a19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>
#include <unistd.h>
#include <iostream>
#include <string>

#include "xsl_processor.hh"

using namespace std;

int
main(int argc, char* argv[])
{
  if (argc < 2) {
    printf("usage: %s <xsl_file>\n", argv[0]);
    printf("       (takes XML from stdin)\n"); 
    exit(1);
  }

  char buf[2048];
  string xml_str = "";
  while (fgets(buf, 2048, stdin) != NULL) {
    xml_str += buf;
  }
  
  string xsl_file(argv[1]);
  list<pair<string,string> > listParams;
  XSLProcessor xsl_processor(false);
  cout << xsl_processor.transform(xml_str, xsl_file, listParams) << endl;

  exit(0);
}