ximol/parser/utils.hpp

Go to the documentation of this file.
00001 /*****************************************************************************\
00002  *                                                                           *
00003  * library XiMoL                                                             *
00004  * Copyright (C) 2002, 2003, 2004 Florent Tournois                           *
00005  *                                                                           *
00006  * This library is free software; you can redistribute it and/or             *
00007  * modify it under the terms of the GNU Lesser General Public                *
00008  * License as published by the Free Software Foundation; either              *
00009  * version 2.1 of the License, or (at your option) any later version.        *
00010  *                                                                           *
00011  * This library is distributed in the hope that it will be useful,           *
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00014  * Lesser General Public License for more details.                           *
00015  *                                                                           *
00016  * You should have received a copy of the GNU Lesser General Public          *
00017  * License along with this library; if not, write to the Free Software       *
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA   *
00019  *                                                                           *
00020 \*****************************************************************************/
00021 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00022 /** \file 
00023         \brief All parser functions declarations.
00024         
00025         \author Tournois Florent
00026         \version 1.0
00027 
00028     $Id: utils.hpp,v 1.10 2004/02/22 10:27:34 tournois Exp $
00029     $Log: utils.hpp,v $
00030     Revision 1.10  2004/02/22 10:27:34  tournois
00031     Add some doc.
00032 
00033     Revision 1.9  2004/02/22 09:54:20  tournois
00034     Change years on the copyright.
00035 
00036     Revision 1.8  2004/01/09 18:26:29  tournois
00037     Add box and content manipulator.
00038 
00039     Revision 1.7  2003/11/27 15:31:55  hfp
00040     partially adapted to vc6.
00041 
00042     Revision 1.6  2003/11/16 13:25:25  tournois
00043     Change the error to use wide string.
00044     Change the translation to use wide string.
00045 
00046     Revision 1.5  2003/11/02 19:23:01  tournois
00047     Go to the boost coding standard.
00048     Change all name to lower case.
00049 
00050     Revision 1.4  2003/10/25 13:53:40  hfp
00051     review and separation
00052 
00053     Revision 1.3  2003/10/08 19:59:35  tournois
00054     no message
00055 
00056     Revision 1.2  2003/09/27 22:49:34  tournois
00057     add the UTF-7 BOM.
00058     UTF-7 files can have a BOM too: 2B 2F 76 38 2D (ASCII +/v8-).
00059 
00060     Revision 1.1  2003/09/24 08:28:17  tournois
00061     Create the namespace Encoders, Parser, Xml
00062     Change the library organization.
00063     add VC7.1 project for this organization.
00064 
00065   */
00066 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00067 #ifndef XIMOL_PARSER_UTILS_HPP_
00068 #define XIMOL_PARSER_UTILS_HPP_
00069 
00070 #include <ximol/typedefs.hpp>
00071 #include <ximol/export_defs.hpp>
00072 
00073 
00074 // forwarded declarations
00075 XIMOL_BEGIN_NAMESPACE
00076         class xostream;
00077         class xistream;
00078 XIMOL_END_NAMESPACE
00079 
00080 XIMOL_XML_BEGIN_NAMESPACE
00081         class attributes;
00082 XIMOL_XML_END_NAMESPACE
00083 
00084 
00085 XIMOL_PARSER_BEGIN_NAMESPACE
00086 
00087 //-----------------------------------------------------------------------------
00088 /** Put a char in the stream
00089  *  Do not use this function.
00090  *  @param xos : the output stream
00091  *  @param xc : the charater
00092  */
00093 //-----------------------------------------------------------------------------
00094 XIMOL_EXPORT void write_xchar(xostream& xos, xchar_t xc);
00095 
00096 //-----------------------------------------------------------------------------
00097 /** read Special char.
00098  *  @ingroup parser_read 
00099  *  read the first char from the stream and throw an error if this char is not
00100  *  xc
00101  *  @param xis : the input stream
00102  *  @param xc : the waited charater
00103  *  @param error_msg : the error message
00104  */
00105 //-----------------------------------------------------------------------------
00106 XIMOL_EXPORT
00107 xistream& read_xchar(xistream& xis, 
00108                                                   xchar_t xc, 
00109                                                   const ::std::wstring & error_msg = L"");
00110 
00111 //-----------------------------------------------------------------------------
00112 /** read Char defined by a function.
00113  *  @ingroup parser_read 
00114  *  read a character defined by a function. This function test if 
00115  *  the character is valid.
00116  *
00117  *  @param xis : the input stream
00118  *  @param xc : the readed character in return
00119  *  @param is_good_xchar : the test function that define a set of character
00120  *  @param error_msg : the error message
00121  */
00122 //-----------------------------------------------------------------------------
00123 XIMOL_EXPORT
00124 xistream& read_xchar(xistream& xis, 
00125                                                   xchar_t & xc,
00126                                                   bool (*is_good_xchar)(xchar_t),
00127                                                   const ::std::wstring & error_msg = L"");
00128 
00129 //-----------------------------------------------------------------------------
00130 /** read string defined by a function.
00131  *  @ingroup parser_read 
00132  *  read char x from input until is_good_xchar(x)==false
00133  *  
00134  *  @param xis : the input stream
00135  *  @param xstr : the readed string in return
00136  *  @param is_good_xchar : the test function that define a set of character
00137  *  @param erase_string : true if you want to erase the string before reading.
00138  */
00139 //-----------------------------------------------------------------------------
00140 XIMOL_EXPORT
00141 xistream& read_xstring(xistream& xis, 
00142                                                     xstring & xstr,
00143                                                     bool (*is_good_xchar)(xchar_t),
00144                                                         bool erase_string = true);
00145 
00146 //-----------------------------------------------------------------------------
00147 /** Test string defined by a function.
00148  *  @ingroup parser_is 
00149  *  Test if each char of the string return true with the function.
00150  * 
00151  *  @param xstr : the string to test
00152  *  @param is_good_xchar : the test function that define a set of character
00153  */
00154 //-----------------------------------------------------------------------------
00155 XIMOL_EXPORT
00156 bool is_xstring(const xstring & xstr, bool (*is_good_xchar)(xchar_t));
00157 
00158 //-----------------------------------------------------------------------------
00159 /** read Special string.
00160  *  @ingroup parser_read 
00161  *  read a constant string and verifie the exact math
00162  * 
00163  *  @param xis : the input stream
00164  *  @param xstr : the constant string to verifie
00165  *  @param error_msg : the error message
00166  *  @param nb_read : number of character already verifie.
00167  */
00168 //-----------------------------------------------------------------------------
00169 XIMOL_EXPORT
00170 xistream& read_xstring(xistream& xistream_, const ::std::string& str_,
00171                                            const ::std::wstring& strErrorMsg_ = L"",
00172                                            size_t size_ = 0);
00173 
00174 //-----------------------------------------------------------------------------
00175 /// write a ForbiddenSerie
00176 /** @ingroup parser_write
00177         ForbiddenSerie    ::=    SetByFunction - (SetByFunction forbidden_string SetByFunction) 
00178 
00179     @param xos : the ouput stream.
00180         @param xstr : the string to write
00181         @param is_good_xchar : function for testing char
00182     @param forbidden_string :  the forbidden string
00183         @param entity_test : name of the tested string (for example : "CharData"). For error message.
00184         @param entity_definition : Definition For error message. (for example : "CharData    ::=    [^<&]* - ([^<&]* ']]>' [^<&]*)").
00185   */
00186 //-----------------------------------------------------------------------------
00187 XIMOL_EXPORT
00188 xostream& write_string_with_forbidden_serie(xostream& xos, 
00189                                                                                 const xstring & xstr,
00190                                                                                 bool (*is_good_xchar)(xchar_t),
00191                                                                                 const ::std::string& forbidden_string,
00192                                                                                 const ::std::string& entity_test,
00193                                                                                 const ::std::string& entity_definition);
00194 
00195 //-----------------------------------------------------------------------------
00196 /// read a ForbiddenSerie
00197 /** @ingroup parser_read
00198         ForbiddenSerie    ::=    SetByFunction - (SetByFunction forbidden_string SetByFunction) 
00199         the reading is stop by the last char of the forbidden string 
00200         and we putback only the last char of this forbidden string.
00201   */
00202 //-----------------------------------------------------------------------------
00203 XIMOL_EXPORT
00204 xistream& read_string_with_forbidden_serie(xistream& xis, 
00205                                            xstring & xstr,
00206                                            bool (*is_good_xchar)(xchar_t),
00207                                            const ::std::string& forbidden_string);
00208 
00209 //-----------------------------------------------------------------------------
00210 /// test ForbiddenSerie
00211 /** @ingroup parser_test
00212         ForbiddenSerie    ::=    SetByFunction - (SetByFunction forbidden_string SetByFunction) 
00213   */
00214 //-----------------------------------------------------------------------------
00215 XIMOL_EXPORT
00216 bool is_string_with_forbidden_serie(const xstring & xstr,
00217                                     bool (*is_good_xchar)(xchar_t),
00218                                     const ::std::string& forbidden_string);
00219 
00220 //-----------------------------------------------------------------------------
00221 /// test if a char is in the range.
00222 /** @ingroup parser_is
00223         test if lower <= c <= upper
00224    
00225     @param c : char to test
00226     @param lower : lower bound
00227     @param upper : upper bound
00228    
00229     @return bool  : result (lower <= c <= upper)
00230 */
00231 //-----------------------------------------------------------------------------
00232 XIMOL_EXPORT
00233 bool is_in_range(xchar_t c, xchar_t lower, xchar_t upper);
00234 
00235 //-----------------------------------------------------------------------------
00236 /// test if a char is a space.
00237 /** @ingroup parser_is
00238         White Space
00239 <pre>
00240     S    ::=    (#x20 | #x9 | #xD | #xA)
00241 </pre>
00242 */
00243 //-----------------------------------------------------------------------------
00244 XIMOL_EXPORT
00245 bool is_space(xchar_t c);
00246 
00247 //-----------------------------------------------------------------------------
00248 /// test if a char is a digit.
00249 /** @ingroup parser_is
00250 <pre>
00251         Digit    ::=    [#x0030-#x0039] 
00252                   | [#x0660-#x0669] 
00253                                   | [#x06F0-#x06F9] 
00254                                   | [#x0966-#x096F] 
00255                                   | [#x09E6-#x09EF] 
00256                                   | [#x0A66-#x0A6F] 
00257                                   | [#x0AE6-#x0AEF] 
00258                                   | [#x0B66-#x0B6F] 
00259                                   | [#x0BE7-#x0BEF] 
00260                                   | [#x0C66-#x0C6F] 
00261                                   | [#x0CE6-#x0CEF] 
00262                                   | [#x0D66-#x0D6F] 
00263                                   | [#x0E50-#x0E59] 
00264                                   | [#x0ED0-#x0ED9] 
00265                                   | [#x0F20-#x0F29] 
00266 </pre>
00267 */
00268 //-----------------------------------------------------------------------------
00269 XIMOL_EXPORT
00270 bool is_digit(xchar_t c);
00271 
00272 //-----------------------------------------------------------------------------
00273 /// test if a char is a XML char.
00274 /** @ingroup parser_is
00275 <pre>
00276         Char    ::=    #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] 
00277                  | [#x10000-#x10FFFF]  
00278 </pre>
00279 */
00280 //-----------------------------------------------------------------------------
00281 XIMOL_EXPORT
00282 bool is_char(xchar_t c);
00283 
00284 //-----------------------------------------------------------------------------
00285 /// test if a char is a letter.
00286 /** @ingroup parser_is
00287 <pre>
00288         Letter    ::=    BaseChar | Ideographic 
00289 </pre>
00290 */
00291 //-----------------------------------------------------------------------------
00292 XIMOL_EXPORT
00293 bool is_letter(xchar_t c);
00294 
00295 //-----------------------------------------------------------------------------
00296 /// test if a char is a combining char.
00297 /** @ingroup parser_is
00298 <pre>
00299         CombiningChar    ::=  [#x0300-#x0345] | [#x0360-#x0361] | [#x0483-#x0486] 
00300                         | [#x0591-#x05A1] | [#x05A3-#x05B9] | [#x05BB-#x05BD] 
00301                                                 | #x05BF | [#x05C1-#x05C2] | #x05C4 | [#x064B-#x0652] 
00302                                                 | #x0670 | [#x06D6-#x06DC] | [#x06DD-#x06DF] 
00303                                                 | [#x06E0-#x06E4] | [#x06E7-#x06E8] | [#x06EA-#x06ED] 
00304                                                 | [#x0901-#x0903] | #x093C | [#x093E-#x094C] | #x094D 
00305                                                 | [#x0951-#x0954] | [#x0962-#x0963] | [#x0981-#x0983] 
00306                                                 | #x09BC | #x09BE | #x09BF | [#x09C0-#x09C4] 
00307                                                 | [#x09C7-#x09C8] | [#x09CB-#x09CD] | #x09D7 
00308                                                 | [#x09E2-#x09E3] | #x0A02 | #x0A3C | #x0A3E | #x0A3F 
00309                                                 | [#x0A40-#x0A42] | [#x0A47-#x0A48] | [#x0A4B-#x0A4D] 
00310                                                 | [#x0A70-#x0A71] | [#x0A81-#x0A83] | #x0ABC 
00311                                                 | [#x0ABE-#x0AC5] | [#x0AC7-#x0AC9] | [#x0ACB-#x0ACD] 
00312                                                 | [#x0B01-#x0B03] | #x0B3C | [#x0B3E-#x0B43] 
00313                                                 | [#x0B47-#x0B48] | [#x0B4B-#x0B4D] | [#x0B56-#x0B57] 
00314                                                 | [#x0B82-#x0B83] | [#x0BBE-#x0BC2] | [#x0BC6-#x0BC8] 
00315                                                 | [#x0BCA-#x0BCD] | #x0BD7 | [#x0C01-#x0C03] 
00316                                                 | [#x0C3E-#x0C44] | [#x0C46-#x0C48] | [#x0C4A-#x0C4D] 
00317                                                 | [#x0C55-#x0C56] | [#x0C82-#x0C83] | [#x0CBE-#x0CC4] 
00318                                                 | [#x0CC6-#x0CC8] | [#x0CCA-#x0CCD] | [#x0CD5-#x0CD6] 
00319                                                 | [#x0D02-#x0D03] | [#x0D3E-#x0D43] | [#x0D46-#x0D48] 
00320                                                 | [#x0D4A-#x0D4D] | #x0D57 | #x0E31 | [#x0E34-#x0E3A] 
00321                                                 | [#x0E47-#x0E4E] | #x0EB1 | [#x0EB4-#x0EB9] 
00322                                                 | [#x0EBB-#x0EBC] | [#x0EC8-#x0ECD] | [#x0F18-#x0F19] 
00323                                                 | #x0F35 | #x0F37 | #x0F39 | #x0F3E | #x0F3F 
00324                                                 | [#x0F71-#x0F84] | [#x0F86-#x0F8B] | [#x0F90-#x0F95] 
00325                                                 | #x0F97 | [#x0F99-#x0FAD] | [#x0FB1-#x0FB7] | #x0FB9 
00326                                                 | [#x20D0-#x20DC] | #x20E1 | [#x302A-#x302F] | #x3099 
00327                                                 | #x309A 
00328 </pre>
00329 */
00330 //-----------------------------------------------------------------------------
00331 XIMOL_EXPORT
00332 bool is_combining_char(xchar_t c);
00333 
00334 //-----------------------------------------------------------------------------
00335 /// test if a char is a base char.
00336 /** @ingroup parser_is
00337 <pre>
00338         BaseChar    ::=    [#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] 
00339                      | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131] 
00340                                          | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E] 
00341                                          | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5] 
00342                                          | [#x01FA-#x0217] | [#x0250-#x02A8] | [#x02BB-#x02C1] 
00343                                          | #x0386 | [#x0388-#x038A] | #x038C | [#x038E-#x03A1] 
00344                                          | [#x03A3-#x03CE] | [#x03D0-#x03D6] | #x03DA | #x03DC 
00345                                          | #x03DE | #x03E0 | [#x03E2-#x03F3] | [#x0401-#x040C] 
00346                                          | [#x040E-#x044F] | [#x0451-#x045C] | [#x045E-#x0481] 
00347                                          | [#x0490-#x04C4] | [#x04C7-#x04C8] | [#x04CB-#x04CC] 
00348                                          | [#x04D0-#x04EB] | [#x04EE-#x04F5] | [#x04F8-#x04F9] 
00349                                          | [#x0531-#x0556] | #x0559 | [#x0561-#x0586] 
00350                                          | [#x05D0-#x05EA] | [#x05F0-#x05F2] | [#x0621-#x063A] 
00351                                          | [#x0641-#x064A] | [#x0671-#x06B7] | [#x06BA-#x06BE] 
00352                                          | [#x06C0-#x06CE] | [#x06D0-#x06D3] | #x06D5 
00353                                          | [#x06E5-#x06E6] | [#x0905-#x0939] | #x093D 
00354                                          | [#x0958-#x0961] | [#x0985-#x098C] | [#x098F-#x0990] 
00355                                          | [#x0993-#x09A8] | [#x09AA-#x09B0] | #x09B2 
00356                                          | [#x09B6-#x09B9] | [#x09DC-#x09DD] | [#x09DF-#x09E1] 
00357                                          | [#x09F0-#x09F1] | [#x0A05-#x0A0A] | [#x0A0F-#x0A10] 
00358                                          | [#x0A13-#x0A28] | [#x0A2A-#x0A30] | [#x0A32-#x0A33] 
00359                                          | [#x0A35-#x0A36] | [#x0A38-#x0A39] | [#x0A59-#x0A5C] 
00360                                          | #x0A5E | [#x0A72-#x0A74] | [#x0A85-#x0A8B] | #x0A8D 
00361                                          | [#x0A8F-#x0A91] | [#x0A93-#x0AA8] | [#x0AAA-#x0AB0] 
00362                                          | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] | #x0ABD | #x0AE0 
00363                                          | [#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28] 
00364                                          | [#x0B2A-#x0B30] | [#x0B32-#x0B33] | [#x0B36-#x0B39] 
00365                                          | #x0B3D | [#x0B5C-#x0B5D] | [#x0B5F-#x0B61] 
00366                      | [#x0B85-#x0B8A] | [#x0B8E-#x0B90] | [#x0B92-#x0B95] 
00367                                          | [#x0B99-#x0B9A] | #x0B9C | [#x0B9E-#x0B9F] 
00368                                          | [#x0BA3-#x0BA4] | [#x0BA8-#x0BAA] | [#x0BAE-#x0BB5] 
00369                      | [#x0BB7-#x0BB9] | [#x0C05-#x0C0C] | [#x0C0E-#x0C10] 
00370                      | [#x0C12-#x0C28] | [#x0C2A-#x0C33] | [#x0C35-#x0C39] 
00371                                          | [#x0C60-#x0C61] | [#x0C85-#x0C8C] | [#x0C8E-#x0C90] 
00372                                          | [#x0C92-#x0CA8] | [#x0CAA-#x0CB3] | [#x0CB5-#x0CB9] 
00373                                          | #x0CDE | [#x0CE0-#x0CE1] | [#x0D05-#x0D0C] 
00374                                          | [#x0D0E-#x0D10] | [#x0D12-#x0D28] 
00375                      | [#x0D2A-#x0D39] | [#x0D60-#x0D61] 
00376                                          | [#x0E01-#x0E2E] | #x0E30 | [#x0E32-#x0E33] 
00377                                          | [#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84 
00378                                          | [#x0E87-#x0E88] | #x0E8A | #x0E8D | [#x0E94-#x0E97] 
00379                                          | [#x0E99-#x0E9F] | [#x0EA1-#x0EA3] | #x0EA5 | #x0EA7 
00380                      | [#x0EAA-#x0EAB] | [#x0EAD-#x0EAE] | #x0EB0 
00381                                          | [#x0EB2-#x0EB3] | #x0EBD | [#x0EC0-#x0EC4] 
00382                                          | [#x0F40-#x0F47] | [#x0F49-#x0F69] | [#x10A0-#x10C5] 
00383                                          | [#x10D0-#x10F6] | #x1100 | [#x1102-#x1103] 
00384                                          | [#x1105-#x1107] | #x1109 | [#x110B-#x110C] 
00385                      | [#x110E-#x1112] | #x113C | #x113E | #x1140 | #x114C 
00386                                          | #x114E | #x1150 | [#x1154-#x1155] | #x1159 
00387                                          | [#x115F-#x1161] | #x1163 | #x1165 | #x1167 | #x1169 
00388                                          | [#x116D-#x116E] | [#x1172-#x1173] | #x1175 | #x119E 
00389                                          | #x11A8 | #x11AB | [#x11AE-#x11AF] | [#x11B7-#x11B8] 
00390                      | #x11BA | [#x11BC-#x11C2] | #x11EB | #x11F0 | #x11F9 
00391                                          | [#x1E00-#x1E9B] | [#x1EA0-#x1EF9] | [#x1F00-#x1F15] 
00392                                          | [#x1F18-#x1F1D] | [#x1F20-#x1F45] | [#x1F48-#x1F4D] 
00393                                          | [#x1F50-#x1F57] | #x1F59 | #x1F5B | #x1F5D 
00394                                          | [#x1F5F-#x1F7D] | [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] 
00395                      | #x1FBE | [#x1FC2-#x1FC4] | [#x1FC6-#x1FCC] 
00396                                          | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB] | [#x1FE0-#x1FEC] 
00397                                          | [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC] | #x2126 
00398                                          | [#x212A-#x212B] | #x212E | [#x2180-#x2182] 
00399                                          | [#x3041-#x3094] | [#x30A1-#x30FA] | [#x3105-#x312C] 
00400                      | [#xAC00-#xD7A3] 
00401 </pre>
00402 */
00403 //-----------------------------------------------------------------------------
00404 XIMOL_EXPORT
00405 bool is_base_char(xchar_t c);
00406 
00407 //-----------------------------------------------------------------------------
00408 /// test if a char is a Ideographic.
00409 /** @ingroup parser_is
00410 <pre>
00411         Ideographic    ::=    [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]  
00412 </pre>
00413   */
00414 //-----------------------------------------------------------------------------
00415 XIMOL_EXPORT
00416 bool is_ideographic(xchar_t c);
00417 
00418 //-----------------------------------------------------------------------------
00419 /// test if a char is an extender.
00420 /** @ingroup parser_is
00421 <pre>
00422         Extender    ::=    #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | #x0E46 
00423       | #x0EC6 | #x3005 | [#x3031-#x3035] | [#x309D-#x309E] | [#x30FC-#x30FE]  
00424 </pre>
00425   */
00426 //-----------------------------------------------------------------------------
00427 XIMOL_EXPORT
00428 bool is_extender(xchar_t c);
00429 
00430 //-----------------------------------------------------------------------------
00431 /// test if a char is a name character
00432 /** @ingroup parser_is
00433 <pre>
00434         NameChar    ::=    Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender   
00435 </pre>
00436   */
00437 //-----------------------------------------------------------------------------
00438 XIMOL_EXPORT
00439 bool is_name_char(xchar_t c);
00440 
00441 //-----------------------------------------------------------------------------
00442 /// test if a char is a PubidChar
00443 /** @ingroup parser_is
00444 <pre>
00445         PubidChar    ::=    #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] 
00446 </pre>
00447   */
00448 //-----------------------------------------------------------------------------
00449 XIMOL_EXPORT
00450 bool is_pubid_char(xchar_t c);
00451 
00452 //-----------------------------------------------------------------------------
00453 /// write a space
00454 /** @ingroup parser_write
00455 <pre>
00456         S ::= (x20 | x9 | xD | xA) 
00457 </pre>
00458   */
00459 //-----------------------------------------------------------------------------
00460 XIMOL_EXPORT
00461 xostream& write_space(xostream& xos);
00462 
00463 //-----------------------------------------------------------------------------
00464 /// read one or more spaces
00465 /** @ingroup parser_read
00466 <pre>
00467         S ::= (x20 | x9 | xD | xA) 
00468 </pre>
00469   */
00470 //-----------------------------------------------------------------------------
00471 XIMOL_EXPORT
00472 xistream& read_space(xistream& xis);
00473 
00474 //-----------------------------------------------------------------------------
00475 /// read zero or more spaces
00476 /** @ingroup parser_read
00477 <pre>
00478         S ::= (x20 | x9 | xD | xA) 
00479 </pre>
00480   */
00481 //-----------------------------------------------------------------------------
00482 XIMOL_EXPORT
00483 xistream& read_optionnal_space(xistream& xis);
00484 
00485 //-----------------------------------------------------------------------------
00486 /// write a name
00487 /** @ingroup parser_write
00488 <pre>
00489         name    ::=    (Letter | '_' | ':') (NameChar)* 
00490 </pre>
00491   */
00492 //-----------------------------------------------------------------------------
00493 XIMOL_EXPORT
00494 xostream& write_name(xostream& xos, const xstring & xstr);
00495 
00496 //-----------------------------------------------------------------------------
00497 /// read a name
00498 /** @ingroup parser_read
00499 <pre>
00500         name    ::=    (Letter | '_' | ':') (NameChar)* 
00501 </pre>
00502   */
00503 //-----------------------------------------------------------------------------
00504 XIMOL_EXPORT
00505 xistream& read_name(xistream& xis, xstring & xstr);
00506 
00507 //-----------------------------------------------------------------------------
00508 /// test name
00509 /** @ingroup parser_is
00510 <pre>
00511         name    ::=    (Letter | '_' | ':') (NameChar)* 
00512 </pre>
00513   */
00514 //-----------------------------------------------------------------------------
00515 XIMOL_EXPORT
00516 bool is_name(const xstring & xstr);
00517 
00518 //-----------------------------------------------------------------------------
00519 /// write a NCName
00520 /** @ingroup parser_write
00521 <pre>
00522         NCName    ::=    (Letter | '_') (NCNameChar)* 
00523 </pre>
00524   */
00525 //-----------------------------------------------------------------------------
00526 XIMOL_EXPORT
00527 xostream& write_ncname(xostream& xos, const xstring & xstr);
00528 
00529 //-----------------------------------------------------------------------------
00530 /// read a NCName
00531 /** @ingroup parser_read
00532 <pre>
00533         NCName    ::=    (Letter | '_') (NCNameChar)* 
00534 </pre>
00535   */
00536 //-----------------------------------------------------------------------------
00537 XIMOL_EXPORT
00538 xistream& read_ncname(xistream& xis, xstring & xstr);
00539 
00540 //-----------------------------------------------------------------------------
00541 /// test NCName
00542 /** @ingroup parser_is
00543 <pre>
00544         NCName    ::=    (Letter | '_') (NCNameChar)* 
00545 </pre>
00546   */
00547 //-----------------------------------------------------------------------------
00548 XIMOL_EXPORT
00549 bool is_ncname(const xstring & xstr);
00550 
00551 //-----------------------------------------------------------------------------
00552 /// write a QName
00553 /** @ingroup parser_write
00554 <pre>
00555         QName ::=  (Prefix ':')? LocalPart 
00556         Prefix ::=  NCName 
00557         LocalPart ::=  NCName 
00558 </pre>
00559   */
00560 //-----------------------------------------------------------------------------
00561 XIMOL_EXPORT
00562 xostream& write_qname(xostream& xos, const xstring & localPart, const xstring & prefix = xstring());
00563 
00564 //-----------------------------------------------------------------------------
00565 /// read a QName
00566 /** @ingroup parser_read
00567 <pre>
00568         QName ::=  (Prefix ':')? LocalPart 
00569         Prefix ::=  NCName 
00570         LocalPart ::=  NCName 
00571 </pre>
00572   */
00573 //-----------------------------------------------------------------------------
00574 XIMOL_EXPORT
00575 xistream& read_qname(xistream& xis, xstring & localPart, xstring & prefix);
00576 
00577 //-----------------------------------------------------------------------------
00578 /// test QName
00579 /** @ingroup parser_is
00580 <pre>
00581         QName ::=  (Prefix ':')? LocalPart 
00582         Prefix ::=  NCName 
00583         LocalPart ::=  NCName 
00584 </pre>
00585   */
00586 //-----------------------------------------------------------------------------
00587 XIMOL_EXPORT
00588 bool is_qname(const xstring & localPart, const xstring & prefix = xstring());
00589 
00590 //-----------------------------------------------------------------------------
00591 /// write a NSAttName
00592 /** @ingroup parser_write
00593 @param xstr : NCName.
00594 <pre>
00595         NSAttName ::=  PrefixedAttName | DefaultAttName 
00596         PrefixedAttName ::=  'xmlns:' NCName
00597         DefaultAttName ::=  'xmlns' 
00598 </pre>
00599   */
00600 //-----------------------------------------------------------------------------
00601 XIMOL_EXPORT
00602 xostream& write_ns_att_name(xostream& xos, const xstring & xstr);
00603 
00604 //-----------------------------------------------------------------------------
00605 /// read a NSAttName
00606 /** @ingroup parser_read
00607 @return only the NCName.
00608 <pre>
00609         NSAttName ::=  PrefixedAttName | DefaultAttName 
00610         PrefixedAttName ::=  'xmlns:' NCName
00611         DefaultAttName ::=  'xmlns' 
00612 </pre>
00613   */
00614 //-----------------------------------------------------------------------------
00615 XIMOL_EXPORT
00616 xistream& read_ns_att_name(xistream& xis, xstring & xstr, int nb_read = 0);
00617 
00618 //-----------------------------------------------------------------------------
00619 /// test NSAttName
00620 /** @ingroup parser_is
00621 test only the NCName. In the Default case, NCName=="".
00622 <pre>
00623         NSAttName ::=  PrefixedAttName | DefaultAttName 
00624         PrefixedAttName ::=  'xmlns:' NCName
00625         DefaultAttName ::=  'xmlns' 
00626 </pre>
00627   */
00628 //-----------------------------------------------------------------------------
00629 XIMOL_EXPORT
00630 bool is_ns_att_name(const xstring & xstr);
00631 
00632 //-----------------------------------------------------------------------------
00633 /// Test first char of a name
00634 /** @ingroup parser_is
00635 <pre>
00636         char    ::=    (Letter | '_' | ':') 
00637 </pre>
00638   */ 
00639 //-----------------------------------------------------------------------------
00640 XIMOL_EXPORT
00641 bool is_first_char_name(xchar_t xc);
00642 
00643 //-----------------------------------------------------------------------------
00644 /// Test first char of a name
00645 /** @ingroup parser_is
00646 <pre>
00647         char    ::=    (Letter | '_' ) 
00648 </pre>
00649   */ 
00650 //-----------------------------------------------------------------------------
00651 XIMOL_EXPORT
00652 bool is_first_char_ncname(xchar_t xc);
00653 
00654 //-----------------------------------------------------------------------------
00655 /// write a CharData
00656 /** @ingroup parser_write
00657 <pre>
00658         CharData    ::=    [^<&]* - ([^<&]* ']]>' [^<&]*) 
00659 </pre>
00660   */
00661 //-----------------------------------------------------------------------------
00662 XIMOL_EXPORT
00663 xostream& write_char_data(xostream& xos, const xstring & xstr);
00664 
00665 //-----------------------------------------------------------------------------
00666 /// read a CharData
00667 /** @ingroup parser_read
00668 <pre>
00669         CharData    ::=    [^<&]* - ([^<&]* ']]>' [^<&]*) 
00670 </pre>
00671         the reading is stop by '<' or '&' or ']]>' 
00672         and we putback only one char '<' or '&' or '>'
00673   */
00674 //-----------------------------------------------------------------------------
00675 XIMOL_EXPORT
00676 xistream& read_char_data(xistream& xis, xstring & xstr);
00677 
00678 //-----------------------------------------------------------------------------
00679 /// test CharData
00680 /** @ingroup parser_is
00681 <pre>
00682         CharData    ::=    [^<&]* - ([^<&]* ']]>' [^<&]*)  
00683 </pre>
00684   */
00685 //-----------------------------------------------------------------------------
00686 XIMOL_EXPORT
00687 bool is_char_data(const xstring & xstr);
00688 
00689 //-----------------------------------------------------------------------------
00690 /// write a Nmtoken
00691 /** @ingroup parser_write
00692 <pre>
00693         Nmtoken    ::=    (NameChar)+  
00694 </pre>
00695   */
00696 //-----------------------------------------------------------------------------
00697 XIMOL_EXPORT
00698 xostream& write_nm_token(xostream& xos, const xstring & xstr);
00699 
00700 //-----------------------------------------------------------------------------
00701 /// read a Nmtoken
00702 /** @ingroup parser_read
00703 <pre>
00704         Nmtoken    ::=    (NameChar)+  
00705 </pre>
00706   */
00707 //-----------------------------------------------------------------------------
00708 XIMOL_EXPORT
00709 xistream& read_nm_token(xistream& xis, xstring & xstr);
00710 
00711 //-----------------------------------------------------------------------------
00712 /// test Nmtoken
00713 /** @ingroup parser_is
00714 <pre>
00715         Nmtoken    ::=    (NameChar)+  
00716 </pre>
00717   */
00718 //-----------------------------------------------------------------------------
00719 XIMOL_EXPORT
00720 bool is_nm_token(const xstring & xstr);
00721 
00722 //-----------------------------------------------------------------------------
00723 /// write a CharRef
00724 /** @ingroup parser_write
00725 <pre>
00726         CharRef    ::=    '&#' [0-9]+ ';'  
00727                     | '&#x' [0-9a-fA-F]+ ';' 
00728 </pre>
00729   */
00730 //-----------------------------------------------------------------------------
00731 XIMOL_EXPORT
00732 xostream& write_char_ref(xostream& xos, xchar_t xc);
00733 
00734 //-----------------------------------------------------------------------------
00735 /// read a CharRef
00736 /** @ingroup parser_read
00737 <pre>
00738         CharRef    ::=    '&#' [0-9]+ ';'  
00739                     | '&#x' [0-9a-fA-F]+ ';' 
00740 </pre>
00741         if read_first_char==true then the char '&' is not read.
00742   */
00743 //-----------------------------------------------------------------------------
00744 XIMOL_EXPORT
00745 xistream& read_char_ref(xistream& xis, xchar_t & xc, int nb_read = 0);
00746 
00747 //-----------------------------------------------------------------------------
00748 /// replace all Charref in the string
00749 /** @ingroup parser_read
00750 <pre>
00751         CharRef    ::=    '&#' [0-9]+ ';'  
00752                     | '&#x' [0-9a-fA-F]+ ';' 
00753 </pre>
00754   */
00755 //-----------------------------------------------------------------------------
00756 XIMOL_EXPORT
00757 xstring replace_char_ref(const xstring& xstr);
00758 
00759 //-----------------------------------------------------------------------------
00760 /// write a EntityRef
00761 /** @ingroup parser_write
00762 <pre>
00763         EntityRef    ::=    '&' name ';' 
00764 </pre>
00765   */
00766 //-----------------------------------------------------------------------------
00767 XIMOL_EXPORT
00768 xostream& write_entity_ref(xostream& xos, const xstring & xstr);
00769 
00770 //-----------------------------------------------------------------------------
00771 /// read a EntityRef
00772 /** @ingroup parser_read
00773 <pre>
00774         EntityRef    ::=    '&' name ';' 
00775 </pre>
00776   */
00777 //-----------------------------------------------------------------------------
00778 XIMOL_EXPORT
00779 xistream& read_entity_ref(xistream& xis, int nb_read = 0);
00780 
00781 //-----------------------------------------------------------------------------
00782 /// write a PEReference
00783 /** @ingroup parser_write
00784 <pre>
00785         PEReference    ::=    '%' name ';'  
00786 </pre>
00787   */
00788 //-----------------------------------------------------------------------------
00789 XIMOL_EXPORT
00790 xostream& write_pe_reference(xostream& xos, const xstring & xstr);
00791 
00792 //-----------------------------------------------------------------------------
00793 /// read a PEReference
00794 /** @ingroup parser_read
00795 <pre>
00796         PEReference    ::=    '%' name ';'  
00797 </pre>
00798   */
00799 //-----------------------------------------------------------------------------
00800 XIMOL_EXPORT
00801 xistream& read_pe_reference(xistream& xis, xstring & xstr, int nb_read = 0);
00802 
00803 //-----------------------------------------------------------------------------
00804 /// read a Reference
00805 /** @ingroup parser_read
00806 <pre>
00807         Reference    ::=    EntityRef | CharRef  
00808 </pre>
00809   */
00810 //-----------------------------------------------------------------------------
00811 XIMOL_EXPORT
00812 xistream& read_reference(xistream& xis, xstring & xstr, int nb_read = 0);
00813 
00814 //-----------------------------------------------------------------------------
00815 /// write a pubid_literal
00816 /** @ingroup parser_write
00817 <pre>
00818         pubid_literal    ::=    '"' PubidChar* '"' | "'" (PubidChar - "'")* "'" 
00819         we use only the value without quote.  
00820 </pre>
00821   */
00822 //-----------------------------------------------------------------------------
00823 XIMOL_EXPORT
00824 xostream& write_pubid_literal(xostream& xos, const xstring & xstr);
00825 
00826 //-----------------------------------------------------------------------------
00827 /// read a pubid_literal
00828 /** @ingroup parser_read
00829 <pre>
00830         pubid_literal    ::=    '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"   
00831 </pre>
00832         we use only the value without quote.  
00833   */
00834 //-----------------------------------------------------------------------------
00835 XIMOL_EXPORT
00836 xistream& read_pubid_literal(xistream& xis, xstring & xstr);
00837 
00838 //-----------------------------------------------------------------------------
00839 /// write a system_literal
00840 /** @ingroup parser_write
00841 <pre>
00842         system_literal    ::=    ('"' [^"]* '"') | ("'" [^']* "'")  
00843 </pre>
00844         we use only the value without quote.  
00845   */
00846 //-----------------------------------------------------------------------------
00847 XIMOL_EXPORT
00848 xostream& write_system_literal(xostream& xos, const xstring & xstr, xchar_t quote=0x0022);
00849 
00850 //-----------------------------------------------------------------------------
00851 /// read a system_literal
00852 /** @ingroup parser_read
00853 <pre>
00854         system_literal    ::=    ('"' [^"]* '"') | ("'" [^']* "'")    
00855 </pre>
00856         we use only the value without quote.  
00857   */
00858 //-----------------------------------------------------------------------------
00859 XIMOL_EXPORT
00860 xistream& read_system_literal(xistream& xis, xstring & xstr);
00861 
00862 //-----------------------------------------------------------------------------
00863 /// write a entity_value
00864 /** @ingroup parser_write
00865 <pre>
00866         entity_value    ::=    '"' ([^%&"] | PEReference | Reference)* '"'  
00867                        |  "'" ([^%&'] | PEReference | Reference)* "'" 
00868 </pre>
00869         we use only the value without quote.  
00870   */
00871 //-----------------------------------------------------------------------------
00872 XIMOL_EXPORT
00873 xostream& write_entity_value(xostream& xos, const xstring & xstr, xchar_t quote=0x0022);
00874 
00875 //-----------------------------------------------------------------------------
00876 /// read a entity_value
00877 /** @ingroup parser_read
00878 <pre>
00879         entity_value    ::=    '"' ([^%&"] | PEReference | Reference)* '"'  
00880                        |  "'" ([^%&'] | PEReference | Reference)* "'" 
00881 </pre>
00882         we use only the value without quote.  
00883   */
00884 //-----------------------------------------------------------------------------
00885 XIMOL_EXPORT
00886 xistream& read_entity_value(xistream& xis, xstring & xstr);
00887 
00888 //-----------------------------------------------------------------------------
00889 /// write a AttValue
00890 /** @ingroup parser_write
00891 <pre>
00892         AttValue    ::=    '"' ([^<&"] | Reference)* '"'  
00893                     |  "'" ([^<&'] | Reference)* "'" 
00894 </pre>
00895         we use only the value without quote.  
00896   */
00897 //-----------------------------------------------------------------------------
00898 XIMOL_EXPORT
00899 xostream& write_att_value(xostream& xos, const xstring & xstr, xchar_t quote=0x0022);
00900 
00901 //-----------------------------------------------------------------------------
00902 /// read a AttValue
00903 /** @ingroup parser_read
00904 <pre>
00905         AttValue    ::=    '"' ([^<&"] | Reference)* '"'  
00906                     |  "'" ([^<&'] | Reference)* "'" 
00907 </pre>
00908         we use only the value without quote.  
00909   */
00910 //-----------------------------------------------------------------------------
00911 XIMOL_EXPORT
00912 xistream& read_att_value(xistream& xis, xstring & xstr);
00913 
00914 //-----------------------------------------------------------------------------
00915 /// write a Attribute
00916 /** @ingroup parser_write
00917 <pre>
00918         Attribute    ::=    name Eq AttValue  
00919 </pre>
00920         we use only the value without quote.  
00921   */
00922 //-----------------------------------------------------------------------------
00923 XIMOL_EXPORT
00924 xostream& write_attribute(xostream& xos, const xstring & name, const xstring & att_value, const xstring & short_ns, xchar_t quote=0x0022);
00925 
00926 //-----------------------------------------------------------------------------
00927 /// read a Attribute
00928 /** @ingroup parser_read
00929 <pre>
00930         Attribute    ::=    name Eq AttValue 
00931 </pre>
00932         we use only the value without quote.  
00933   */
00934 //-----------------------------------------------------------------------------
00935 XIMOL_EXPORT
00936 xistream& read_attribute(xistream& xis, xstring & name, xstring & att_value, xstring& short_ns);
00937 
00938 //-----------------------------------------------------------------------------
00939 /// Test comment
00940 /** @ingroup parser_is
00941 <pre>
00942         comment    ::=    '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->' 
00943 </pre>
00944   */
00945 //-----------------------------------------------------------------------------
00946 XIMOL_EXPORT
00947 bool is_comment(const xstring & xstr);
00948 
00949 //-----------------------------------------------------------------------------
00950 /// write a comment
00951 /** @ingroup parser_write
00952 <pre>
00953         comment    ::=    '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->' 
00954 </pre>
00955   */
00956 //-----------------------------------------------------------------------------
00957 XIMOL_EXPORT
00958 xostream& write_comment(xostream& xos, const xstring & xstr);
00959 
00960 //-----------------------------------------------------------------------------
00961 /// read a comment
00962 /** @ingroup parser_read
00963 <pre>
00964         comment    ::=    '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->' 
00965 </pre>
00966   */
00967 //-----------------------------------------------------------------------------
00968 XIMOL_EXPORT
00969 xistream& read_comment(xistream& xis, xstring & xstr, int nb_read=0);
00970 
00971 //-----------------------------------------------------------------------------
00972 /// read a comment
00973 /** @ingroup parser_read
00974 <pre>
00975         comment    ::=    '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->' 
00976 </pre>
00977   */
00978 //-----------------------------------------------------------------------------
00979 XIMOL_EXPORT
00980 xistream& read_comment(xistream& xis, int nb_read=0);
00981 
00982 //-----------------------------------------------------------------------------
00983 /// Test pi_target
00984 /** @ingroup parser_is
00985 <pre>
00986         pi_target    ::=    name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) 
00987 </pre>
00988   */
00989 //-----------------------------------------------------------------------------
00990 XIMOL_EXPORT
00991 bool is_pi_target(const xstring & xstr);
00992 
00993 //-----------------------------------------------------------------------------
00994 /// write a pi_target
00995 /** @ingroup parser_write
00996 <pre>
00997         pi_target    ::=    name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) 
00998 </pre>
00999   */
01000 //-----------------------------------------------------------------------------
01001 XIMOL_EXPORT
01002 xostream& write_pi_target(xostream& xos, const xstring & xstr);
01003 
01004 //-----------------------------------------------------------------------------
01005 /// read a pi_target
01006 /** @ingroup parser_read
01007 <pre>
01008         pi_target    ::=    name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) 
01009 </pre>
01010   */
01011 //-----------------------------------------------------------------------------
01012 XIMOL_EXPORT
01013 xistream& read_pi_target(xistream& xis, xstring & xstr);
01014 
01015 //-----------------------------------------------------------------------------
01016 /// write a PI
01017 /** @ingroup parser_write
01018 <pre>
01019         PI    ::=    '<?' pi_target (S (Char* - (Char* '?>' Char*)))? '?>' 
01020 </pre>
01021   */
01022 //-----------------------------------------------------------------------------
01023 XIMOL_EXPORT
01024 xostream& write_pi(xostream& xos, const xstring & pi_target, const xstring & xext);
01025 
01026 //-----------------------------------------------------------------------------
01027 /// read a PI
01028 /** @ingroup parser_read
01029 <pre>
01030         PI    ::=    '<?' pi_target (S (Char* - (Char* '?>' Char*)))? '?>' 
01031 </pre>
01032   */
01033 //-----------------------------------------------------------------------------
01034 XIMOL_EXPORT
01035 xistream& read_pi(xistream& xis, xstring & pi_target,xstring & xext, int nb_read=0);
01036 
01037 //-----------------------------------------------------------------------------
01038 /// read a PI
01039 /** @ingroup parser_read
01040 <pre>
01041         PI    ::=    '<?' pi_target (S (Char* - (Char* '?>' Char*)))? '?>' 
01042 </pre>
01043   */
01044 //-----------------------------------------------------------------------------
01045 XIMOL_EXPORT
01046 xistream& read_pi(xistream& xis, int nb_read=0);
01047 
01048 //-----------------------------------------------------------------------------
01049 /// write a cd_end
01050 /** @ingroup parser_write
01051 <pre>
01052         cd_end    ::=    ']]>' 
01053 </pre>
01054   */
01055 //-----------------------------------------------------------------------------
01056 XIMOL_EXPORT
01057 xostream& write_cd_end(xostream& xos);
01058 
01059 //-----------------------------------------------------------------------------
01060 /// read a cd_end
01061 /** @ingroup parser_read
01062 <pre>
01063         cd_end    ::=    ']]>' 
01064 </pre>
01065   */
01066 //-----------------------------------------------------------------------------
01067 XIMOL_EXPORT
01068 xistream& read_cd_end(xistream& xis, int nb_read=0);
01069 
01070 //-----------------------------------------------------------------------------
01071 /// write a cd_start
01072 /** @ingroup parser_write
01073 <pre>
01074         cd_start    ::=    '<![CDATA[' 
01075 </pre>
01076   */
01077 //-----------------------------------------------------------------------------
01078 XIMOL_EXPORT
01079 xostream& write_cd_start(xostream& xos);
01080 
01081 //-----------------------------------------------------------------------------
01082 /// read a cd_start
01083 /** @ingroup parser_read
01084 <pre>
01085         cd_start    ::=    '<![CDATA[' 
01086 </pre>
01087   */
01088 //-----------------------------------------------------------------------------
01089 XIMOL_EXPORT
01090 xistream& read_cd_start(xistream& xis, int nb_read=0);
01091 
01092 //-----------------------------------------------------------------------------
01093 /// write a CData
01094 /** @ingroup parser_write
01095 <pre>
01096         CData    ::=    (Char* - (Char* ']]>' Char*))  
01097 </pre>
01098   */
01099 //-----------------------------------------------------------------------------
01100 XIMOL_EXPORT
01101 xostream& write_cdata(xostream& xos, const xstring & xstr);
01102 
01103 //-----------------------------------------------------------------------------
01104 /// read a CData
01105 /** @ingroup parser_read
01106 <pre>
01107         CData    ::=    (Char* - (Char* ']]>' Char*))  
01108 </pre>
01109   */
01110 //-----------------------------------------------------------------------------
01111 XIMOL_EXPORT
01112 xistream& read_cdata(xistream& xis, xstring & xstr);
01113 
01114 //-----------------------------------------------------------------------------
01115 /// write a cd_sect
01116 /** @ingroup parser_write
01117 <pre>
01118         cd_sect    ::=    cd_start CData cd_end 
01119 </pre>
01120   */
01121 //-----------------------------------------------------------------------------
01122 XIMOL_EXPORT
01123 xostream& write_cd_sect(xostream& xos, const xstring & xstr);
01124 
01125 //-----------------------------------------------------------------------------
01126 /// read a cd_sect
01127 /** @ingroup parser_read
01128 <pre>
01129         cd_sect    ::=    cd_start CData cd_end 
01130 </pre>
01131   */
01132 //-----------------------------------------------------------------------------
01133 XIMOL_EXPORT
01134 xistream& read_cd_sect(xistream& xis, xstring & xstr, int nb_char=0);
01135 
01136 //-----------------------------------------------------------------------------
01137 /// write a Eq
01138 /** @ingroup parser_write
01139 <pre>
01140         Eq    ::=    S? '=' S?  
01141 </pre>
01142   */
01143 //-----------------------------------------------------------------------------
01144 XIMOL_EXPORT
01145 xostream& write_eq(xostream& xos);
01146 
01147 //-----------------------------------------------------------------------------
01148 /// read a Eq
01149 /** @ingroup parser_read
01150 <pre>
01151         Eq    ::=    S? '=' S?  
01152 </pre>
01153   */
01154 //-----------------------------------------------------------------------------
01155 XIMOL_EXPORT
01156 xistream& read_eq(xistream& xis);
01157 
01158 //-----------------------------------------------------------------------------
01159 /// Test VersionNum
01160 /** @ingroup parser_is
01161 <pre>
01162         VersionNum    ::=    ([a-zA-Z0-9_.:] | '-')+ 
01163 </pre>
01164   */
01165 //-----------------------------------------------------------------------------
01166 XIMOL_EXPORT
01167 bool is_version_num(const xstring & xstr);
01168 
01169 //-----------------------------------------------------------------------------
01170 /// write a VersionNum
01171 /** @ingroup parser_write
01172 <pre>
01173         VersionNum    ::=    ([a-zA-Z0-9_.:] | '-')+ 
01174 </pre>
01175   */
01176 //-----------------------------------------------------------------------------
01177 XIMOL_EXPORT
01178 xostream& write_version_num(xostream& xos, const xstring & xstr);
01179 
01180 //-----------------------------------------------------------------------------
01181 /// read a VersionNum
01182 /** @ingroup parser_read
01183 <pre>
01184         VersionNum    ::=    ([a-zA-Z0-9_.:] | '-')+ 
01185 </pre>
01186   */
01187 //-----------------------------------------------------------------------------
01188 XIMOL_EXPORT
01189 xistream& read_version_num(xistream& xis, xstring & xstr);
01190 
01191 //-----------------------------------------------------------------------------
01192 /// write a VersionInfo
01193 /** @ingroup parser_write
01194 <pre>
01195         VersionInfo    ::=    S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')  
01196 </pre>
01197   */
01198 //-----------------------------------------------------------------------------
01199 XIMOL_EXPORT
01200 xostream& write_version_info(xostream& xos, const xstring & xstr);
01201 
01202 //-----------------------------------------------------------------------------
01203 /// read a VersionInfo
01204 /** @ingroup parser_read
01205 <pre>
01206         VersionInfo    ::=    S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')  
01207 </pre>
01208   */
01209 //-----------------------------------------------------------------------------
01210 XIMOL_EXPORT
01211 xistream& read_version_info(xistream& xis, xstring & xstr, bool read_first_space=true);
01212 
01213 //-----------------------------------------------------------------------------
01214 /// read a VersionInfo
01215 /** @ingroup parser_read
01216 <pre>
01217         VersionInfo    ::=    S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')  
01218 </pre>
01219   */
01220 //-----------------------------------------------------------------------------
01221 XIMOL_EXPORT
01222 xistream& read_version_info(xistream& xis, bool read_first_space=true);
01223 
01224 //-----------------------------------------------------------------------------
01225 /// Test EncName
01226 /** @ingroup parser_is
01227 <pre>
01228         EncName    ::=    [A-Za-z] ([A-Za-z0-9._] | '-')* 
01229 </pre>
01230   */
01231 //-----------------------------------------------------------------------------
01232 XIMOL_EXPORT
01233 bool is_enc_name(const xstring & xstr);
01234 
01235 //-----------------------------------------------------------------------------
01236 /// write a EncName
01237 /** @ingroup parser_write
01238 <pre>
01239         EncName    ::=    [A-Za-z] ([A-Za-z0-9._] | '-')* 
01240 </pre>
01241   */
01242 //-----------------------------------------------------------------------------
01243 XIMOL_EXPORT
01244 xostream& write_enc_name(xostream& xos, const xstring & xstr);
01245 
01246 //-----------------------------------------------------------------------------
01247 /// read a EncName
01248 /** @ingroup parser_read
01249 <pre>
01250         EncName    ::=    [A-Za-z] ([A-Za-z0-9._] | '-')* 
01251 </pre>
01252   */
01253 //-----------------------------------------------------------------------------
01254 XIMOL_EXPORT
01255 xistream& read_enc_name(xistream& xis, xstring & xstr);
01256 
01257 //-----------------------------------------------------------------------------
01258 /// write a EncodingDecl
01259 /** @ingroup parser_write
01260 <pre>
01261         EncodingDecl    ::=    S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" ) 
01262 </pre>
01263   */
01264 //-----------------------------------------------------------------------------
01265 XIMOL_EXPORT
01266 xostream& write_encoding_decl(xostream& xos, const xstring & xstr);
01267 
01268 //-----------------------------------------------------------------------------
01269 /// read a EncodingDecl
01270 /** @ingroup parser_read
01271 <pre>
01272         EncodingDecl    ::=    S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" ) 
01273 </pre>
01274   */
01275 //-----------------------------------------------------------------------------
01276 XIMOL_EXPORT
01277 xistream& read_encoding_decl(xistream& xis, xstring & xstr, bool read_first_space=true);
01278 
01279 //-----------------------------------------------------------------------------
01280 /// write a SDDecl
01281 /** @ingroup parser_write
01282 <pre>
01283         SDDecl    ::=    S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"')) 
01284 </pre>
01285   */
01286 //-----------------------------------------------------------------------------
01287 XIMOL_EXPORT
01288 xostream& write_sd_decl(xostream& xos, bool standalone);
01289 
01290 //-----------------------------------------------------------------------------
01291 /// read a SDDecl
01292 /** @ingroup parser_read
01293 <pre>
01294         SDDecl    ::=    S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"')) 
01295 </pre>
01296   */
01297 //-----------------------------------------------------------------------------
01298 XIMOL_EXPORT
01299 xistream& read_sd_decl(xistream& xis, bool & standalone, bool read_first_space=true);
01300 
01301 //-----------------------------------------------------------------------------
01302 /// write a XMLDecl
01303 /** @ingroup parser_write
01304 <pre>
01305         XMLDecl    ::=    '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' 
01306 </pre>
01307   */
01308 //-----------------------------------------------------------------------------
01309 XIMOL_EXPORT
01310 xostream& write_xml_decl(xostream& xos, const xstring& version_info, const xstring& encoding_decl = L"", const xstring& standalone_decl = L"");
01311 
01312 //-----------------------------------------------------------------------------
01313 /// write a XMLDecl
01314 /** @ingroup parser_write
01315 <pre>
01316         XMLDecl    ::=    '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' 
01317 </pre>
01318   */
01319 //-----------------------------------------------------------------------------
01320 XIMOL_EXPORT
01321 xostream& write_xml_decl(xostream& xos);
01322 
01323 //-----------------------------------------------------------------------------
01324 /// read a XMLDecl
01325 /** @ingroup parser_read
01326 <pre>
01327         XMLDecl    ::=    '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' 
01328 </pre>
01329   */
01330 //-----------------------------------------------------------------------------
01331 XIMOL_EXPORT
01332 xistream& read_xml_decl(xistream& xis, xstring& version_info, xstring& encoding_decl, bool & standalone_decl, int nb_read=0);
01333 
01334 //-----------------------------------------------------------------------------
01335 /// read a XMLDecl
01336 /** @ingroup parser_read
01337 <pre>
01338         XMLDecl    ::=    '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' 
01339 </pre>
01340   */
01341 //-----------------------------------------------------------------------------
01342 XIMOL_EXPORT
01343 xistream& read_xml_decl(xistream& xis, int nb_read=0);
01344 
01345 //-----------------------------------------------------------------------------
01346 /// write a ExternalID
01347 /** @ingroup parser_write
01348 <pre>
01349         ExternalID    ::=    'SYSTEM' S system_literal | 'PUBLIC' S pubid_literal S system_literal  
01350 </pre>
01351   */
01352 //-----------------------------------------------------------------------------
01353 XIMOL_EXPORT
01354 xostream& write_external_id(xostream& xos, const xstring& system_literal, const xstring& pub_id_literal=xstring());
01355 
01356 //-----------------------------------------------------------------------------
01357 /// read a ExternalID
01358 /** @ingroup parser_read
01359 <pre>
01360         ExternalID    ::=    'SYSTEM' S system_literal | 'PUBLIC' S pubid_literal S system_literal  
01361 </pre>
01362   */
01363 //-----------------------------------------------------------------------------
01364 XIMOL_EXPORT
01365 xistream& read_external_id(xistream& xis, xstring& system_literal, xstring& pub_id_literal);
01366 
01367 //-----------------------------------------------------------------------------
01368 /// write a PublicID
01369 /** @ingroup parser_write
01370 <pre>
01371         PublicID    ::=    'PUBLIC' S pubid_literal 
01372 </pre>
01373   */
01374 //-----------------------------------------------------------------------------
01375 XIMOL_EXPORT
01376 xostream& write_public_id(xostream& xos, const xstring& pub_id_literal);
01377 
01378 //-----------------------------------------------------------------------------
01379 /// read a PublicID
01380 /** @ingroup parser_read
01381 <pre>
01382         PublicID    ::=    'PUBLIC' S pubid_literal 
01383 </pre>
01384   */
01385 //-----------------------------------------------------------------------------
01386 XIMOL_EXPORT
01387 xistream& read_public_id(xistream& xis, xstring& pub_id_literal);
01388 
01389 //-----------------------------------------------------------------------------
01390 /// write a NotationDecl
01391 /** @ingroup parser_write
01392 <pre>
01393         NotationDecl    ::=    '<!NOTATION' S name S (ExternalID | PublicID) S? '>' 
01394 </pre>
01395   */
01396 //-----------------------------------------------------------------------------
01397 XIMOL_EXPORT
01398 xostream& write_notation_decl(xostream& xos, const xstring& name, const xstring& system_literal, const xstring& pub_id_literal);
01399 
01400 //-----------------------------------------------------------------------------
01401 /// read a NotationDecl
01402 /** @ingroup parser_read
01403 <pre>
01404         NotationDecl    ::=    '<!NOTATION' S name S (ExternalID | PublicID) S? '>' 
01405 </pre>
01406   */
01407 //-----------------------------------------------------------------------------
01408 XIMOL_EXPORT
01409 xistream& read_notation_decl(xistream& xis, xstring& name, xstring& system_literal, xstring& pub_id_literal, int nb_read=0);
01410 
01411 //-----------------------------------------------------------------------------
01412 /// read a NotationDecl
01413 /** @ingroup parser_read
01414 <pre>
01415         NotationDecl    ::=    '<!NOTATION' S name S (ExternalID | PublicID) S? '>' 
01416 </pre>
01417   */
01418 //-----------------------------------------------------------------------------
01419 XIMOL_EXPORT
01420 xistream& read_notation_decl(xistream& xis, int nb_read=0);
01421 
01422 //-----------------------------------------------------------------------------
01423 /// write a PEDef
01424 /** @ingroup parser_write
01425 <pre>
01426         PEDef    ::=    entity_value | ExternalID 
01427 </pre>
01428   */
01429 //-----------------------------------------------------------------------------
01430 XIMOL_EXPORT
01431 xostream& write_pe_def(xostream& xos, const xstring& entity_value, const xstring& system_literal, const xstring& pub_id_literal);
01432 
01433 //-----------------------------------------------------------------------------
01434 /// read a PEDef
01435 /** @ingroup parser_read
01436 <pre>
01437         PEDef    ::=    entity_value | ExternalID 
01438 </pre>
01439   */
01440 //-----------------------------------------------------------------------------
01441 XIMOL_EXPORT
01442 xistream& read_pe_def(xistream& xis, xstring& entity_value, xstring& system_literal, xstring& pub_id_literal);
01443 
01444 //-----------------------------------------------------------------------------
01445 /// write an open stag
01446 /** @ingroup parser_write
01447 <pre>
01448         stag    ::=    '<' name (S Attribute)* S? '>' 
01449 </pre>
01450   */
01451 //-----------------------------------------------------------------------------
01452 XIMOL_EXPORT
01453 xostream& write_open_stag(xostream& xos, const xstring& name, const XIMOL_XML_NAMESPACE_PATH::attributes& att, const xstring& uri=xstring());
01454 
01455 //-----------------------------------------------------------------------------
01456 /// write an open stag
01457 /** @ingroup parser_write
01458 <pre>
01459         stag    ::=    '<' name (S Attribute)* S? '>' 
01460 </pre>
01461   */
01462 //-----------------------------------------------------------------------------
01463 XIMOL_EXPORT
01464 xostream& write_open_stag(xostream& xos, const xstring& name, const xstring& uri = xstring());
01465 
01466 //-----------------------------------------------------------------------------
01467 /// write a stag
01468 /** @ingroup parser_write
01469 <pre>
01470         stag    ::=    '<' QName (S Attribute)* S? '>' 
01471 </pre>
01472   */
01473 //-----------------------------------------------------------------------------
01474 XIMOL_EXPORT
01475 xostream& write_stag(xostream& xos, const xstring& name, const XIMOL_XML_NAMESPACE_PATH::attributes& att, const xstring& uri = xstring());
01476 
01477 //-----------------------------------------------------------------------------
01478 /// write a stag
01479 /** @ingroup parser_write
01480 <pre>
01481         stag    ::=    '<' QName (S Attribute)* S? '>' 
01482 </pre>
01483   */
01484 //-----------------------------------------------------------------------------
01485 XIMOL_EXPORT
01486 xostream& write_stag(xostream& xos, const xstring& name);
01487 
01488 //-----------------------------------------------------------------------------
01489 /// write a stag
01490 /** @ingroup parser_write
01491 <pre>
01492         stag    ::=    '<' QName (S Attribute)* S? '>' 
01493 </pre>
01494   */
01495 //-----------------------------------------------------------------------------
01496 XIMOL_EXPORT
01497 xostream& write_stag(xostream& xos, const xstring& name, const xstring& uri);
01498 
01499 //-----------------------------------------------------------------------------
01500 /// read an open stag
01501 /** @ingroup parser_read
01502 <pre>
01503         stag    ::=    '<' QName (S Attribute)* S? '>'  
01504 </pre>
01505   */
01506 //-----------------------------------------------------------------------------
01507 XIMOL_EXPORT
01508 xistream& read_open_stag(xistream& xis, xstring& name, XIMOL_XML_NAMESPACE_PATH::attributes& att, xstring& uri, int nb_read=0);
01509 
01510 //-----------------------------------------------------------------------------
01511 /// read an open stag
01512 /** @ingroup parser_read
01513 <pre>
01514         stag    ::=    '<' QName (S Attribute)* S? '>'  
01515 </pre>
01516   */
01517 //-----------------------------------------------------------------------------
01518 XIMOL_EXPORT
01519 xistream& read_open_stag(xistream& xis, xstring& name, xstring &uri, int nb_read=0);
01520 
01521 //-----------------------------------------------------------------------------
01522 /// read an open stag
01523 /** @ingroup parser_read
01524 <pre>
01525         stag    ::=    '<' QName (S Attribute)* S? '>'  
01526 </pre>
01527   */
01528 //-----------------------------------------------------------------------------
01529 XIMOL_EXPORT
01530 xistream& read_open_stag(xistream& xis, xstring& name, int nb_read=0);
01531 
01532 //-----------------------------------------------------------------------------
01533 /// read a stag
01534 /** @ingroup parser_read
01535 <pre>
01536         stag    ::=    '<' QName (S Attribute)* S? '>'  
01537 </pre>
01538   */
01539 //-----------------------------------------------------------------------------
01540 XIMOL_EXPORT
01541 xistream& read_stag(xistream& xis, xstring& name, XIMOL_XML_NAMESPACE_PATH::attributes& att, xstring& uri, int nb_read=0);
01542 
01543 //-----------------------------------------------------------------------------
01544 /// read a stag
01545 /** @ingroup parser_read
01546 <pre>
01547         stag    ::=    '<' QName (S Attribute)* S? '>'  
01548 </pre>
01549   */
01550 //-----------------------------------------------------------------------------
01551 XIMOL_EXPORT
01552 xistream& read_stag(xistream& xis, xstring& name, XIMOL_XML_NAMESPACE_PATH::attributes& att, int nb_read=0);
01553 
01554 //-----------------------------------------------------------------------------
01555 /// read a stag
01556 /** @ingroup parser_read
01557 <pre>
01558         stag    ::=    '<' QName (S Attribute)* S? '>'  
01559 </pre>
01560   */
01561 //-----------------------------------------------------------------------------
01562 XIMOL_EXPORT
01563 xistream& read_stag(xistream& xis, xstring& name, xstring& uri, int nb_read=0);
01564 
01565 //-----------------------------------------------------------------------------
01566 /// read a stag
01567 /** @ingroup parser_read
01568 <pre>
01569         stag    ::=    '<' QName (S Attribute)* S? '>'  
01570 </pre>
01571   */
01572 //-----------------------------------------------------------------------------
01573 XIMOL_EXPORT
01574 xistream& read_stag(xistream& xis, xstring& name, int nb_read=0);
01575 
01576 //-----------------------------------------------------------------------------
01577 /// write a etag
01578 /** @ingroup parser_write
01579 <pre>
01580         etag    ::=    '</' name S? '>'
01581 </pre>
01582   */
01583 //-----------------------------------------------------------------------------
01584 XIMOL_EXPORT
01585 xostream& write_etag(xostream& xos, const xstring& name, const xstring& uri);
01586 
01587 //-----------------------------------------------------------------------------
01588 /// write a etag
01589 /** @ingroup parser_write
01590 <pre>
01591         etag    ::=    '</' name S? '>'
01592 </pre>
01593   */
01594 //-----------------------------------------------------------------------------
01595 XIMOL_EXPORT
01596 xostream& write_etag(xostream& xos, const xstring& name);
01597 
01598 //-----------------------------------------------------------------------------
01599 /// write a etag
01600 /** @ingroup parser_write
01601 <pre>
01602         etag    ::=    '</' name S? '>'
01603 </pre>
01604   */
01605 //-----------------------------------------------------------------------------
01606 XIMOL_EXPORT
01607 xostream& write_etag(xostream& xos);
01608 
01609 //-----------------------------------------------------------------------------
01610 /// read a etag
01611 /** @ingroup parser_read
01612 <pre>
01613         etag    ::=    '</' QName S? '>' 
01614 </pre>
01615   */
01616 //-----------------------------------------------------------------------------
01617 XIMOL_EXPORT
01618 xistream& read_etag(xistream& xis, xstring& name, xstring& uri, int nb_read=0);
01619 
01620 //-----------------------------------------------------------------------------
01621 /// read a etag
01622 /** @ingroup parser_read
01623 <pre>
01624         etag    ::=    '</' QName S? '>' 
01625 </pre>
01626   */
01627 //-----------------------------------------------------------------------------
01628 XIMOL_EXPORT
01629 xistream& read_etag(xistream& xis, xstring& name, int nb_read=0);
01630 
01631 //-----------------------------------------------------------------------------
01632 /// read a etag
01633 /** @ingroup parser_read
01634 <pre>
01635         etag    ::=    '</' QName S? '>' 
01636 </pre>
01637   */
01638 //-----------------------------------------------------------------------------
01639 XIMOL_EXPORT
01640 xistream& read_etag(xistream& xis, int nb_read=0);
01641 
01642 //-----------------------------------------------------------------------------
01643 /// write a NDataDecl
01644 /** @ingroup parser_write
01645 <pre>
01646         NDataDecl    ::=    S 'NDATA' S name 
01647 </pre>
01648   */
01649 //-----------------------------------------------------------------------------
01650 XIMOL_EXPORT
01651 xostream& write_ndata_decl(xostream& xos, const xstring& name);
01652 
01653 //-----------------------------------------------------------------------------
01654 /// read a NDataDecl
01655 /** @ingroup parser_read
01656 <pre>
01657         NDataDecl    ::=    S 'NDATA' S name 
01658 </pre>
01659   */
01660 //-----------------------------------------------------------------------------
01661 XIMOL_EXPORT
01662 xistream& read_ndata_decl(xistream& xis, xstring& name, int nb_read=0);
01663 
01664 //-----------------------------------------------------------------------------
01665 /// write a EntityDef
01666 /** @ingroup parser_write
01667 <pre>
01668         EntityDef    ::=    entity_value | (ExternalID NDataDecl?) 
01669 </pre>
01670   */
01671 //-----------------------------------------------------------------------------
01672 XIMOL_EXPORT
01673 xostream& write_entity_def(xostream& xos, const xstring& entity_value, const xstring& system_literal, const xstring& pub_id_literal, const xstring& ndata_name);
01674 
01675 //-----------------------------------------------------------------------------
01676 /// read a EntityDef
01677 /** @ingroup parser_read
01678 <pre>
01679         EntityDef    ::=    entity_value | (ExternalID NDataDecl?) 
01680 </pre>
01681   */
01682 //-----------------------------------------------------------------------------
01683 XIMOL_EXPORT
01684 xistream& read_entity_def(xistream& xis, xstring& entity_value, xstring& system_literal, xstring& pub_id_literal, xstring& ndata_name);
01685 
01686 //-----------------------------------------------------------------------------
01687 /// write a PEDecl
01688 /** @ingroup parser_write
01689 <pre>
01690         PEDecl    ::=    '<!ENTITY' S '%' S name S PEDef S? '>' 
01691 </pre>
01692   */
01693 //-----------------------------------------------------------------------------
01694 XIMOL_EXPORT
01695 xostream& write_pe_decl(xostream& xos, const xstring& entity_name, const xstring& entity_value, const xstring& system_literal = L"", const xstring& pubid_literal = L"");
01696 
01697 //-----------------------------------------------------------------------------
01698 /// read a PEDecl
01699 /** @ingroup parser_read
01700 <pre>
01701         PEDecl    ::=    '<!ENTITY' S '%' S name S PEDef S? '>' 
01702 </pre>
01703   */
01704 //-----------------------------------------------------------------------------
01705 XIMOL_EXPORT
01706 xistream& read_pe_decl(xistream& xis, xstring& entity_name, xstring& entity_value, xstring& system_literal, xstring & pubid_literal, int nb_read=0);
01707 
01708 //-----------------------------------------------------------------------------
01709 /// read a PEDecl
01710 /** @ingroup parser_read
01711 <pre>
01712         PEDecl    ::=    '<!ENTITY' S '%' S name S PEDef S? '>' 
01713 </pre>
01714   */
01715 //-----------------------------------------------------------------------------
01716 XIMOL_EXPORT
01717 xistream& read_pe_decl(xistream& xis,int nb_read=0);
01718 
01719 //-----------------------------------------------------------------------------
01720 /// write a GEDecl
01721 /** @ingroup parser_write
01722 <pre>
01723         GEDecl    ::=    '<!ENTITY' S name S EntityDef S? '>'  
01724 </pre>
01725   */
01726 //-----------------------------------------------------------------------------
01727 XIMOL_EXPORT
01728 xostream& write_ge_decl(xostream& xos, const xstring& entity_name, const xstring& entity_value, const xstring& system_literal = L"", const xstring& pubid_literal = L"", const xstring& ndata_name = L"");
01729 
01730 //-----------------------------------------------------------------------------
01731 /// read a GEDecl
01732 /** @ingroup parser_read
01733 <pre>
01734         GEDecl    ::=    '<!ENTITY' S name S EntityDef S? '>'  
01735 </pre>
01736   */
01737 //-----------------------------------------------------------------------------
01738 XIMOL_EXPORT
01739 xistream& read_ge_decl(xistream& xis, xstring& entity_name, xstring& entity_value, xstring& system_literal, xstring & pubid_literal, xstring & ndata_name, int nb_read=0);
01740 
01741 //-----------------------------------------------------------------------------
01742 /// read a GEDecl
01743 /** @ingroup parser_read
01744 <pre>
01745         GEDecl    ::=    '<!ENTITY' S name S EntityDef S? '>' 
01746 </pre>
01747   */
01748 //-----------------------------------------------------------------------------
01749 XIMOL_EXPORT
01750 xistream& read_ge_decl(xistream& xis,int nb_read=0);
01751 
01752 //-----------------------------------------------------------------------------
01753 /// read Misc
01754 /** @ingroup parser_read
01755 <pre>
01756         Misc    ::=    comment | PI | S 
01757 </pre>
01758   */
01759 //-----------------------------------------------------------------------------
01760 XIMOL_EXPORT
01761 xistream& read_misc(xistream& xis);
01762 
01763 //-----------------------------------------------------------------------------
01764 /// write a prolog
01765 /** @ingroup parser_write
01766 <pre>
01767         prolog    ::=    XMLDecl? Misc* (doctypedecl Misc*)? 
01768 </pre>
01769   */
01770 //-----------------------------------------------------------------------------
01771 XIMOL_EXPORT
01772 xostream& write_prolog(xostream& xos);
01773 
01774 //-----------------------------------------------------------------------------
01775 /// Byte Order Mark
01776 /** @ingroup parser_read
01777     Finally, as a side note, and not of any importance, UTF-7 files can 
01778     have a BOM too: 2B 2F 76 38 2D
01779         @return number of xchar_t crunch. xchar_t of the '<?xml'
01780   */
01781 //-----------------------------------------------------------------------------
01782 XIMOL_EXPORT
01783 size_t read_bom(xistream& xis);
01784 
01785 //-----------------------------------------------------------------------------
01786 /// read a prolog question tag
01787 //-----------------------------------------------------------------------------
01788 XIMOL_EXPORT
01789 xistream& read_prolog_question(xistream& xis, int nb_read=0);
01790 
01791 //-----------------------------------------------------------------------------
01792 /// read a prolog exclamation tag
01793 //-----------------------------------------------------------------------------
01794 XIMOL_EXPORT
01795 xistream& read_prolog_exclamation(xistream& xis, int nb_read=0);
01796 
01797 //-----------------------------------------------------------------------------
01798 /// read doctype elements
01799 //-----------------------------------------------------------------------------
01800 XIMOL_EXPORT
01801 xistream& read_doctype_element(xistream& xis, int nb_read=0);
01802 
01803 //-----------------------------------------------------------------------------
01804 /// read doctypedecl
01805 /** @ingroup parser_read
01806 <pre>
01807         doctypedecl    ::=    '<!DOCTYPE' S name (S ExternalID)? S? ('[' (markupdecl | DeclSep)* ']' S?)? '>' 
01808 </pre>
01809   */
01810 //-----------------------------------------------------------------------------
01811 XIMOL_EXPORT
01812 xistream& read_doctype_decl(xistream& xis, int nb_read=0);
01813 
01814 //-----------------------------------------------------------------------------
01815 /// read a prolog
01816 /** @ingroup parser_read
01817 <pre>
01818         prolog    ::=    XMLDecl? Misc* (doctypedecl Misc*)?  
01819 </pre>
01820   */
01821 //-----------------------------------------------------------------------------
01822 XIMOL_EXPORT
01823 xistream& read_prolog(xistream& xis);
01824 
01825 //-----------------------------------------------------------------------------
01826 /// read a elementdecl
01827 /** @ingroup parser_read
01828         \todo write this function
01829 <pre>
01830         elementdecl    ::=    '<!ELEMENT' S name S contentspec S? '>'   
01831 </pre>
01832   */
01833 //-----------------------------------------------------------------------------
01834 XIMOL_EXPORT
01835 xistream& read_element_decl(xistream& xis, int nb_read=0);
01836 
01837 //-----------------------------------------------------------------------------
01838 /// read a AttlistDecl
01839 /** @ingroup parser_read
01840         \todo write this function
01841 <pre>
01842         AttlistDecl    ::=    '<!ATTLIST' S name AttDef* S? '>' 
01843 </pre>
01844   */
01845 //-----------------------------------------------------------------------------
01846 XIMOL_EXPORT
01847 xistream& read_att_list_decl(xistream& xis, int nb_read=0);
01848 
01849 //-----------------------------------------------------------------------------
01850 /// read a EntityDecl
01851 /** @ingroup parser_read
01852   <pre>
01853         EntityDecl    ::=    GEDecl | PEDecl    
01854 </pre>
01855   */
01856 //-----------------------------------------------------------------------------
01857 XIMOL_EXPORT
01858 xistream& read_entity_decl(xistream& xis, int nb_read=0);
01859 
01860 XIMOL_PARSER_END_NAMESPACE
01861 
01862 #endif // #ifndef XIMOL_PARSER_UTILS_HPP_


Donate to the XiMoL project SourceForge.net Logo If you have any questions about XiMoL, you could write to tournois@users.sourceforge.net.