1 /*
2  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  * Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET
4  *
5  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  *
7  * This file is hereby licensed under the terms of the GNU GPL v2.0,
8  * pursuant to article 5.3.4 of the CeCILL v.2.1.
9  * This file was originally licensed under the terms of the CeCILL v2.1,
10  * and continues to be available under such terms.
11  * For more information, see the COPYING file which you should have received
12  * along with this program.
13  *
14  */
15 
16 #ifndef __XMLVALIDATIONDTD_HXX__
17 #define __XMLVALIDATIONDTD_HXX__
18 
19 #include <string>
20 
21 #include "xml.h"
22 
23 namespace org_modules_xml
24 {
25 
26 class XMLValidation;
27 class XMLDocument;
28 
29 /**
30  * @file
31  * @author Calixte DENIZET <calixte.denizet@scilab.org>
32  *
33  * Class to handle DTD validation.
34  */
35 class XMLValidationDTD: public XMLValidation
36 {
37 
38 public:
39     /**
40      * @param path the path of the validation file
41      * @param error a string which will contain error messages
42      */
43     XMLValidationDTD(const char *path, std::string * error);
44 
45     /**
46      * Use internal validation
47      */
48     XMLValidationDTD();
49 
50     ~XMLValidationDTD();
51 
52     bool validate(const XMLDocument & doc, std::string * error) const;
53     bool validate(xmlTextReader * reader, std::string * error) const;
54 
55     const std::string toString() const;
56 
57 private:
58     bool internalValidate;
59 };
60 }
61 
62 #endif
63