00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Base Library 00005 * Module : IXMLParser 00006 * Package : Zeus.ZeusBase.System.Interfaces 00007 * Author : Benjamin Hadorn 00008 * Date : 27.12.2011 00009 * System : Zeus-Framework 00010 ***************************************************************************** 00011 * Licence: * 00012 * This library is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU Lesser General Public License as * 00014 * published by the Free Software Foundation; either version * 00015 * 2.1 of the License, or (at your option) any later version. * 00016 * * 00017 * This library is distributed in the hope that it will be useful, * 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00020 * GNU Lesser General Public License for more details. * 00021 * * 00022 * You should have received a copy of the GNU Lesser General Public * 00023 * License along with this library; if not, write to the Free Software * 00024 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00025 *****************************************************************************/ 00026 00027 /***************************************************************************** 00028 * Changes: 00029 * 27.12.2011 bha: created zeus 2.0 00030 *****************************************************************************/ 00031 00032 #ifndef IXMLParserHPP 00033 #define IXMLParserHPP 00034 00035 #include <zeusbase/System/Interfaces/IZUnknown.hpp> 00036 #include <zeusbase/System/Interfaces/IString.hpp> 00037 #include <zeusbase/System/Interfaces/IXMLDocument.hpp> 00038 #include <zeusbase/System/Interfaces/IXSDDocument.hpp> 00039 #include <zeusbase/System/Interfaces/IXMLErrorReporter.hpp> 00040 00041 00042 //Sets the validation (dtd and schema support) 00043 #define SETTING_PARSER_VALIDATION L"XMLParser.Validation" 00044 00045 //Sets the full schema checking 00046 // ATTENTION: this property is very time consuming 00047 #define SETTING_PARSER_FULLSCHEMA_SUPPORT L"XMLParser.FullSchemaSupport" 00048 00049 //More infomration for editing and debugging xml source files 00050 #define SETTING_PARSER_ADDITIONAL_INFOS L"XMLParser.AdditionalInfos" 00051 00052 00053 // {EF0B7A7B-3BD9-4bb9-94D8-EC2DEF170C8E} 00054 #define INTERFACE_IXMLParser TIID(0xef0b7a7b, 0x3bd9, 0x4bb9, 0x94, 0xd8, 0xec, 0x2d, 0xef, 0x17, 0xc, 0x8e) 00055 00056 BEGIN_NAMESPACE_Zeus 00057 00058 /***************************************************************************/ 00061 /***************************************************************************/ 00062 class IXMLParser : public IZUnknown 00063 { 00064 HIDE_ASSIGNMENT_OPERATOR(IXMLParser) 00065 00066 public: 00067 /**************************************************************************/ 00074 /**************************************************************************/ 00075 virtual Retval MQUALIFIER loadFromFile(const IString& rFileName, IXMLDocument*& rpDocu)=0; 00076 00077 /**************************************************************************/ 00091 /**************************************************************************/ 00092 virtual Retval MQUALIFIER loadXSDFromFile(const IString& rFileName, 00093 IXSDDocument*& rpDocu, 00094 IString& strErrors, 00095 const char* strSchemaNamespacePrefix = "xsd") = 0; 00096 00097 /**************************************************************************/ 00105 /**************************************************************************/ 00106 virtual Retval MQUALIFIER parseStream(const IString& rStream, IXMLDocument*& rpDocu)=0; 00107 00108 /**************************************************************************/ 00113 /**************************************************************************/ 00114 virtual void MQUALIFIER addErrorReporter(IXMLErrorReporter& rReporter)=0; 00115 00116 /**************************************************************************/ 00122 /**************************************************************************/ 00123 virtual Retval MQUALIFIER removeErrorReporter(IXMLErrorReporter& rReporter)=0; 00124 00125 /**************************************************************************/ 00131 /**************************************************************************/ 00132 virtual bool MQUALIFIER getProperty(const IString& rName)const=0; 00133 00134 /**************************************************************************/ 00140 /**************************************************************************/ 00141 virtual void MQUALIFIER setProperty(const IString& rName, bool bValue)=0; 00142 00143 }; 00144 00145 END_NAMESPACE_Zeus 00146 00147 #endif