From be933ef2241d79558f91796cc5b3a161f72ebf9c Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 19 Oct 2020 00:52:24 +0200 Subject: sync with upstream --- xbmc/utils/XSLTUtils.h | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 xbmc/utils/XSLTUtils.h (limited to 'xbmc/utils/XSLTUtils.h') diff --git a/xbmc/utils/XSLTUtils.h b/xbmc/utils/XSLTUtils.h new file mode 100644 index 0000000..78221b9 --- /dev/null +++ b/xbmc/utils/XSLTUtils.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include + +#include +#include + +class XSLTUtils +{ +public: + XSLTUtils(); + ~XSLTUtils(); + + /*! \brief Set the input XML for an XSLT transform from a string. + This sets up the XSLT transformer with some input XML from a string in memory. + The input XML should be well formed. + \param input the XML document to be transformed. + */ + bool SetInput(const std::string& input); + + /*! \brief Set the stylesheet (XSL) for an XSLT transform from a string. + This sets up the XSLT transformer with some stylesheet XML from a string in memory. + The input XSL should be well formed. + \param input the XSL document to be transformed. + */ + bool SetStylesheet(const std::string& stylesheet); + + /*! \brief Perform an XSLT transform on an inbound XML document. + This will apply an XSLT transformation on an input XML document, + giving an output XML document, using the specified XSLT document + as the transformer. + \param input the parent containing the 's. + \param filename the in question. + */ + bool XSLTTransform(std::string& output); + + +private: + xmlDocPtr m_xmlInput = nullptr; + xmlDocPtr m_xmlOutput = nullptr; + xmlDocPtr m_xmlStylesheet = nullptr; + xsltStylesheetPtr m_xsltStylesheet = nullptr; +}; -- cgit v1.2.3