From f4d3cb9184c68201a1c18be97654df6edbd07369 Mon Sep 17 00:00:00 2001 From: Marat Nepomnyashy Date: Fri, 4 Jan 2008 16:37:55 -0800 Subject: The 'render_xml' stuff has been migrated into package 'vyatta-op-xml'. --- Makefile.am | 8 ------ debian/control | 1 - src/render_xml.cc | 31 --------------------- src/xsl_processor.cc | 76 ---------------------------------------------------- src/xsl_processor.hh | 28 ------------------- 5 files changed, 144 deletions(-) delete mode 100644 src/render_xml.cc delete mode 100644 src/xsl_processor.cc delete mode 100644 src/xsl_processor.hh diff --git a/Makefile.am b/Makefile.am index 091e050..c9849cb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,14 +20,6 @@ bin_sudo_users_SCRIPTS += scripts/vyatta-show-log-file bin_sudo_users_SCRIPTS += scripts/vyatta-show-dmesg bin_sudo_users_SCRIPTS += scripts/vyatta-show-dmesg-all -sbin_PROGRAMS = src/render_xml - -src_render_xml_SOURCES = src/render_xml.cc -src_render_xml_SOURCES += src/xsl_processor.cc -src_render_xml_SOURCES += src/xsl_processor.hh -src_render_xml_CPPFLAGS = -I$(srcdir)/src -src_render_xml_LDADD = -lsablot - cpiop = find . ! -regex '\(.*~\|.*\.bak\|.*\.swp\|.*\#.*\#\)' -print0 | \ cpio -0pd diff --git a/debian/control b/debian/control index 63b5611..1cc05f7 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,6 @@ Depends: bash (>= 3.1), lsof, coreutils (>= 5.97-5.3), host, - libsablot0 Suggests: util-linux (>= 2.13-5), net-tools, ncurses-bin (>= 5.5-5), diff --git a/src/render_xml.cc b/src/render_xml.cc deleted file mode 100644 index a213387..0000000 --- a/src/render_xml.cc +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include -#include -#include - -#include "xsl_processor.hh" - -using namespace std; - -int -main(int argc, char* argv[]) -{ - if (argc < 2) { - printf("usage: %s \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 > listParams; - XSLProcessor xsl_processor(false); - cout << xsl_processor.transform(xml_str, xsl_file, listParams) << endl; - - exit(0); -} 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 -#include -#include -#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 > & 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 >::const_iterator i = listParams.begin(); - list >::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; -} diff --git a/src/xsl_processor.hh b/src/xsl_processor.hh deleted file mode 100644 index ac9b047..0000000 --- a/src/xsl_processor.hh +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Module: xsl_processor.hh - * - * Author: Michael Larson - * Date: 2005 - */ -#ifndef __XSL_PROCESSOR_HH__ -#define __XSL_PROCESSOR_HH__ - -#include -#include -#include - - -class XSLProcessor -{ -public: - XSLProcessor(bool debug); - ~XSLProcessor(); - - std::string - transform(const std::string &input, const std::string &xsl, const std::list > & listParams); - -private: - bool _debug; -}; - -#endif //__XSL_PROCESSOR_HH__ -- cgit v1.2.3