xml/legacyminidomparser/XMLParser/INC/GMXMLConstants.h
changeset 34 c7e9f1c97567
parent 25 417699dc19c9
child 36 172b09aa4eb6
equal deleted inserted replaced
25:417699dc19c9 34:c7e9f1c97567
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This file contains generic XML constants
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20 */
       
    21 
       
    22 #ifndef __GMXMLCONSTANTS_H__
       
    23 #define __GMXMLCONSTANTS_H__
       
    24 
       
    25 #include <e32base.h>
       
    26 #include <gmxmldomconstants.h>
       
    27 
       
    28 /** XML file type options. 
       
    29 @publishedPartner
       
    30 @released
       
    31 */
       
    32 enum TXMLFileType
       
    33 	{
       
    34 	/** ASCII file. */
       
    35 	EAscii = 1,
       
    36 	/** Unicode file. */
       
    37 	EUnicode = 2,
       
    38 	/** UTF8 file. */
       
    39 	EUtf8 = 3
       
    40 	};
       
    41 
       
    42 const TInt KReadBufferLen = 1024;
       
    43 const TInt KWriteBufferLen = 1024;
       
    44 
       
    45 // Error codes
       
    46 /** XML element nesting error code. */
       
    47 const TInt KErrXMLBadNesting = 					KErrXMLBase - 4;
       
    48 /** XML element incomplete error code. */
       
    49 const TInt KErrXMLIncomplete = 					KErrXMLBase - 5;
       
    50 /** XML element name error code. */
       
    51 const TInt KErrXMLBadElementName = 				KErrXMLBase - 6;
       
    52 /** Error code that indicates that more than one DOCTYPE tag has been encountered: 
       
    53 the first one encountered will be used. */
       
    54 const TInt KErrXMLDuplicateDocTypeTags = 		KErrXMLBase - 7;
       
    55 /** Error code that indicates that more than one XML version tag has been encountered: 
       
    56 the first one encountered will be used. */
       
    57 const TInt KErrXMLDuplicateVersionTags = 		KErrXMLBase - 8;
       
    58 /** Error code that indicates that more than one element has been encountered at 
       
    59 the root of the document (there should be a single <smil> element). The resulting 
       
    60 tree may be confused, but is provided rather than being discarded. */
       
    61 const TInt KErrXMLDuplicateRootElements =		KErrXMLBase - 9;
       
    62 /** Error code that indicates that no DOCTYPE tag was encountered. */
       
    63 const TInt KErrXMLMissingDocTypeTag = 			KErrXMLBase - 10;
       
    64 /** Error code that indicates that no XML version tag was encountered. */
       
    65 const TInt KErrXMLMissingVersionTag = 			KErrXMLBase - 11;
       
    66 /** Error code that indicates that an element has two or more entries for the same 
       
    67 attribute. */
       
    68 const TInt KErrXMLDuplicateAttributeName =	KErrXMLBase - 12;
       
    69 /** Error code that indicates there is no single root element.
       
    70 
       
    71 This may be the result of two of more root elements being added incorrectly, 
       
    72 or a missing root element leading to the child elements being assumed to be 
       
    73 root nodes. */
       
    74 const TInt KErrXMLMultipleRootElements = 		KErrXMLBase - 13;
       
    75 /** Error code that indicates spurious characters have been found.
       
    76 
       
    77 This may occur as the result of a missing or an extra attribute or element 
       
    78 delimiter. */
       
    79 const TInt KErrXMLCorruptFile = 					KErrXMLBase - 14;
       
    80 /** Error code that indicates a built-in entity or element / attribute delimiter 
       
    81 is at an inappropriate place. */
       
    82 const TInt KErrXMLIllegalCharacter = 			KErrXMLBase - 15;
       
    83 const TInt KErrXMLBadEntity =					KErrXMLBase - 16;
       
    84 /** Error code that indicates an element was found to be invalid by the DTD */
       
    85 const TInt KErrXMLInvalidElement =				KErrXMLBase - 17;
       
    86 /** Error code that indicates an attribute was found to be invalid by the DTD */
       
    87 const TInt KErrXMLInvalidAttribute =			KErrXMLBase - 18;
       
    88 
       
    89 /** Severity levels for XML composer and parser errors. 
       
    90 @publishedPartner
       
    91 @released
       
    92 */
       
    93 enum TXMLErrorCodeSeverity
       
    94 	{
       
    95 	/** Fatal error. */
       
    96 	EXMLFatal,
       
    97 	/** Severity level cannot be determined. */
       
    98 	EXMLIndeterminate,
       
    99 	/** Recoverable error. */
       
   100 	EXMLWorkable,
       
   101 	/** No error. */
       
   102 	EXMLNone
       
   103 	};
       
   104 
       
   105 
       
   106 _LIT(KNewLine, "\r\n");
       
   107 
       
   108 #ifdef _DEBUG
       
   109 	_LIT(KTab, "   ");
       
   110 #endif
       
   111 
       
   112 _LIT(KXMLSemiColon, ";");
       
   113 _LIT(KXMLDecimalId, "&#");
       
   114 _LIT(KXMLHexidecimalId, "&#x");
       
   115 _LIT(KXMLStartComment, "<!--");
       
   116 _LIT(KXMLEndComment, "-->");
       
   117 _LIT(KXMLStartEndTag, "</");
       
   118 _LIT(KXMLStartTag, "<");
       
   119 _LIT(KXMLEndStartTag, "/>");
       
   120 _LIT(KXMLStartProcessingInstruction, "<?");
       
   121 _LIT(KXMLEndProcessingInstruction, "?>");
       
   122 _LIT(KXMLStartCDataSection, "<![CDATA[");
       
   123 _LIT(KXMLEndCDataSection, "]]>");
       
   124 
       
   125 _LIT(KBackSlash, "\\");
       
   126 _LIT(KDash, "-");
       
   127 _LIT(KExclamation, "!");
       
   128 _LIT(KForwardSlash, "/");
       
   129 _LIT(KEqualSign, "=");
       
   130 _LIT(KLeftArrow, "<");
       
   131 _LIT(KRightArrow, ">");
       
   132 _LIT(KAmpersand, "&");
       
   133 _LIT(KApostrophe, "\'");
       
   134 _LIT(KQuotation, "\"");
       
   135 _LIT(KSingleSpace, " ");
       
   136 
       
   137 
       
   138 const TInt KNominalTagLength = 256;
       
   139 const TInt KStartPosition = -1;
       
   140 
       
   141 #endif