summaryrefslogtreecommitdiff
path: root/src/xsl_processor.cc
diff options
context:
space:
mode:
authorMarat Nepomnyashy <marat@vyatta.com>2008-01-04 16:37:55 -0800
committerMarat Nepomnyashy <marat@vyatta.com>2008-01-04 16:37:55 -0800
commitf4d3cb9184c68201a1c18be97654df6edbd07369 (patch)
tree8335410b864044b76b54fba916cac07b87b7ecef /src/xsl_processor.cc
parent2f63b8af6d06eb930cff4b13bb0d4c782f47d8b2 (diff)
downloadvyatta-op-f4d3cb9184c68201a1c18be97654df6edbd07369.tar.gz
vyatta-op-f4d3cb9184c68201a1c18be97654df6edbd07369.zip
The 'render_xml' stuff has been migrated into package 'vyatta-op-xml'.
Diffstat (limited to 'src/xsl_processor.cc')
-rw-r--r--src/xsl_processor.cc76
1 files changed, 0 insertions, 76 deletions
diff --git a/src/xsl_processor.cc b/src/xsl_processor.cc
deleted file mode 100644
index f40b611..0000000
--- a/src/xsl_processor.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Module: xsl_processor.cc
- *
- * Author: Michael Larson
- * Date: 2005
- */
-#include <string>
-#include <iostream>
-#include <sablot.h>
-#include "xsl_processor.hh"
-
-using namespace std;
-
-/**
- *
- **/
-XSLProcessor::XSLProcessor(bool debug) : _debug(debug)
-{
-
-}
-
-/**
- *
- **/
-XSLProcessor::~XSLProcessor()
-{
-
-}
-
-/**
- *
- **/
-std::string
-XSLProcessor::transform(const string &input, const string &xsl, const list<pair<string,string> > & listParams)
-{
- if (_debug) {
- cout << "input to xsl processor: " << endl << input << endl << xsl << endl;
- }
-
- //for now we'll dump this into a file, but this will have to change soon.
- string formatted_output;
-
- //example below from http://www.gingerall.org/ga/html/sablot/sparse-frameset.html
- SablotSituation S;
- SablotHandle proc;
- SDOM_Document xml;
-
- SablotCreateSituation(&S);
-
- SablotParseBuffer(S, input.c_str(), &xml);
-
- SablotCreateProcessorForSituation(S, &proc);
- SablotAddArgTree(S, proc, "data", xml);
- list<pair<string, string> >::const_iterator i = listParams.begin();
- list<pair<string, string> >::const_iterator iEnd = listParams.end();
- while (i != iEnd) {
- SablotAddParam(S, proc, i->first.c_str(), i->second.c_str());
- i++;
- }
- SablotRunProcessorGen(S, proc, xsl.c_str(), "arg:/data", "arg:/out");
-
- char *result;
- SablotGetResultArg(proc, "arg:/out", &result);
-
- formatted_output = result;
-
- //now strip away the first line
- int pos = formatted_output.find("\n");
- formatted_output = formatted_output.substr(pos + 1, formatted_output.length() - pos - 1);
-
- SablotFree(result);
- SablotDestroyProcessor(proc);
- SablotDestroySituation(S);
-
- return formatted_output;
-}