]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/gdome_xslt/C++/gdome_xslt/GdomeSmartDOMXSLTStylesheet.hh
ocaml 3.09 transition
[helm.git] / helm / DEVEL / gdome_xslt / C++ / gdome_xslt / GdomeSmartDOMXSLTStylesheet.hh
1 // This file is part of a XSLT engine working on Gdome documents. In fact,
2 // it just maps Gdome documents to libxml documents back and forth, and
3 // applies the transformation on libxml documents using libxlt.
4 // 
5 // Copyright (C) 2002: Luca Padovani <lpadovan@cs.unibo.it>
6 // 
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // 
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // Lesser General Public License for more details.
16 // 
17 // You should have received a copy of the GNU Lesser General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20 //
21 // For more information, please send an email to lpadovan@cs.unibo.it
22
23 #ifndef __GdomeSmartDOMXSLTStylesheet_hh__
24 #define __GdomeSmartDOMXSLTStylesheet_hh__
25
26 #include <vector>
27 #include <string>
28 #include <stdio.h>
29
30 #include "gdome_xslt.h"
31 #include <GdomeSmartDOM.hh>
32
33 namespace GdomeSmartDOMExt {
34
35   using namespace GdomeSmartDOM;
36
37   class XSLTStylesheet
38   {
39   public:
40     explicit XSLTStylesheet(const Document& doc);
41     ~XSLTStylesheet();
42
43     Document apply(const Document& source) const;
44     Document apply(const Document& source, const std::vector< std::pair<GdomeString, GdomeString> >& params) const;
45     void     save(const Document& result, const std::string& filename) const;
46     void     save(const Document& result, FILE* f) const;
47     void     save(const Document& result, int fd) const;
48
49     class SaveException { };
50
51   private:
52     XSLTStylesheet(const XSLTStylesheet&);
53
54     xsltStylesheet* stylesheet;
55   };
56
57 }
58
59 #endif // __GdomeSmartDOMXSLTStylesheet_hh__