diff options
| author | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
| commit | be933ef2241d79558f91796cc5b3a161f72ebf9c (patch) | |
| tree | fe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/utils/XSLTUtils.h | |
| parent | 5f8335c1e49ce108ef3481863833c98efa00411b (diff) | |
| download | kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2 kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip | |
sync with upstream
Diffstat (limited to 'xbmc/utils/XSLTUtils.h')
| -rw-r--r-- | xbmc/utils/XSLTUtils.h | 51 |
1 files changed, 51 insertions, 0 deletions
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 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include <string> | ||
| 12 | |||
| 13 | #include <libxslt/xslt.h> | ||
| 14 | #include <libxslt/xsltutils.h> | ||
| 15 | |||
| 16 | class XSLTUtils | ||
| 17 | { | ||
| 18 | public: | ||
| 19 | XSLTUtils(); | ||
| 20 | ~XSLTUtils(); | ||
| 21 | |||
| 22 | /*! \brief Set the input XML for an XSLT transform from a string. | ||
| 23 | This sets up the XSLT transformer with some input XML from a string in memory. | ||
| 24 | The input XML should be well formed. | ||
| 25 | \param input the XML document to be transformed. | ||
| 26 | */ | ||
| 27 | bool SetInput(const std::string& input); | ||
| 28 | |||
| 29 | /*! \brief Set the stylesheet (XSL) for an XSLT transform from a string. | ||
| 30 | This sets up the XSLT transformer with some stylesheet XML from a string in memory. | ||
| 31 | The input XSL should be well formed. | ||
| 32 | \param input the XSL document to be transformed. | ||
| 33 | */ | ||
| 34 | bool SetStylesheet(const std::string& stylesheet); | ||
| 35 | |||
| 36 | /*! \brief Perform an XSLT transform on an inbound XML document. | ||
| 37 | This will apply an XSLT transformation on an input XML document, | ||
| 38 | giving an output XML document, using the specified XSLT document | ||
| 39 | as the transformer. | ||
| 40 | \param input the parent containing the <tag>'s. | ||
| 41 | \param filename the <tag> in question. | ||
| 42 | */ | ||
| 43 | bool XSLTTransform(std::string& output); | ||
| 44 | |||
| 45 | |||
| 46 | private: | ||
| 47 | xmlDocPtr m_xmlInput = nullptr; | ||
| 48 | xmlDocPtr m_xmlOutput = nullptr; | ||
| 49 | xmlDocPtr m_xmlStylesheet = nullptr; | ||
| 50 | xsltStylesheetPtr m_xsltStylesheet = nullptr; | ||
| 51 | }; | ||
