ui-gxmlcpp  1.4.4
XSLTransTree.hpp
Go to the documentation of this file.
1 
11 #ifndef UI_GXML_XSLTRANSTREE_HPP
12 #define UI_GXML_XSLTRANSTREE_HPP
13 
14 // STDC++
15 #include <string>
16 
17 // C++ Libraries
18 #include <ui-utilcpp/Text.hpp>
19 #include <ui-gxmlcpp/Tree.hpp>
20 #include <ui-gxmlcpp/XSLTree.hpp>
21 
22 // Include compat w/o warnings or changing external UI_GXMLCPP_IGNORE_DEPRECATED
23 #ifdef UI_GXMLCPP_IGNORE_DEPRECATED
24 #include <ui-gxmlcpp/XMLTree.hpp>
25 #else
26 #define UI_GXMLCPP_IGNORE_DEPRECATED
27 #include <ui-gxmlcpp/XMLTree.hpp>
28 #undef UI_GXMLCPP_IGNORE_DEPRECATED
29 #endif
30 
31 namespace UI {
32 namespace GXML {
33 
35 class XSLTransTree: public Tree
36 {
37 public:
39  enum ErrorCode
40  {
41  Mem_ = 0,
42  Apply_
43  };
46 
48  class Params: private UI::Util::CStrArray
49  {
50  public:
52  Params & add(std::string const & name, std::string const & value);
53  using CStrArray::get;
54  };
55 
57  XSLTransTree(XSLTree const & xslTree, Tree const & tree, Params const & params=Params());
58 
60  XSLTransTree(XSLTree const & style, XMLTree const * const tree, Params const & params=Params());
61 
63  std::string getOutputEncoding() const;
64 
66  class Dump
67  {
68  public:
70  Dump(XSLTransTree const & xslTransTree);
71  ~Dump();
72 
74  std::string getEncoding() const;
75 
78  char const * getC() const;
79  std::string get() const;
80  int getSize() const;
82  private:
83  XSLTransTree const * const xslTransTree_;
84  xmlChar * buf_;
85  int size_;
86  };
87 
88 protected:
89  xsltStylesheet * getStylesheet() const;
90 
91 private:
92  XSLTree const * const xslTree_;
93 };
94 
95 }}
96 #endif
CodeException< ErrorCode > Exception
Exceptions for this class.
Definition: XSLTransTree.hpp:45
Namespace for all Schlund+Partner Code.
Definition: Buffer.cpp:30
XSL (stylesheet) Tree.
Definition: XSLTree.hpp:27
ErrorCode
Error codes for exceptions.
Definition: Tree.hpp:51
Adding code facility to Exception.
Definition: Exception.hpp:34
XSLTransTree(XSLTree const &xslTree, Tree const &tree, Params const &params=Params())
Constructor.
Definition: XSLTransTree.cpp:38
std::string getOutputEncoding() const
See XSLTree::getOutputEncoding().
Definition: XSLTransTree.cpp:61
XSLTransTree serializer.
Definition: XSLTransTree.hpp:66
XML tree.
Definition: Tree.hpp:30
Parameter abstraction for xsl translations.
Definition: XSLTransTree.hpp:48
XSL translation result tree.
Definition: XSLTransTree.hpp:35
Params & add(std::string const &name, std::string const &value)
Add a named parameter.
Definition: XSLTransTree.cpp:31
friend class XMLTree
Compat only.
Definition: Tree.hpp:77