From 998ba210e32dae2101a43ee869b74cebaba0c1b2 Mon Sep 17 00:00:00 2001 From: Tinny Ng <tng@apache.org> Date: Tue, 12 Nov 2002 17:27:49 +0000 Subject: [PATCH] DOM Message: add new domain for DOM Messages. git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@174346 13f79535-47bb-0310-9956-ffa450edef68 --- src/xercesc/NLS/EN_US/XMLErrList_EN_US.Xml | 40 +++++----- .../util/MsgLoaders/ICU/ICUMsgLoader.cpp | 10 ++- .../util/MsgLoaders/ICU/resources/en_US.txt | 29 +++++++- .../MsgLoaders/InMemory/CppErrMsgs_EN_US.hpp | 54 ++++++++++++++ .../MsgLoaders/InMemory/InMemMsgLoader.cpp | 11 +++ .../MsgCatalog/MsgCatalogLoader.cpp | 6 ++ .../MsgLoaders/MsgCatalog/XMLMsgCat_EN_US.Msg | 21 ++++++ .../MsgLoaders/MsgCatalog/XMLMsgCat_Ids.hpp | 1 + .../util/MsgLoaders/MsgFile/MsgLoader.cpp | 24 +++--- .../util/MsgLoaders/Win32/Win32MsgLoader.cpp | 2 + src/xercesc/util/XMLDOMMsg.hpp | 73 +++++++++++++++++++ src/xercesc/util/XMLUni.cpp | 15 ++++ src/xercesc/util/XMLUni.hpp | 1 + tools/NLS/Xlat/Xlat.cpp | 8 ++ tools/NLS/Xlat/Xlat_CppSrc.cpp | 7 ++ tools/NLS/Xlat/Xlat_Win32RC.cpp | 32 +++++--- 16 files changed, 289 insertions(+), 45 deletions(-) create mode 100644 src/xercesc/util/XMLDOMMsg.hpp diff --git a/src/xercesc/NLS/EN_US/XMLErrList_EN_US.Xml b/src/xercesc/NLS/EN_US/XMLErrList_EN_US.Xml index ffc2472a0..c4bea4468 100644 --- a/src/xercesc/NLS/EN_US/XMLErrList_EN_US.Xml +++ b/src/xercesc/NLS/EN_US/XMLErrList_EN_US.Xml @@ -768,26 +768,28 @@ <Message Id="NodeIDMap_GrowErr" Text="NodeIDMap overflows and exceeds the largest available size"/> </FatalError> </MsgDomain> - <MsgDomain Domain="http://apache.org/xml/messages/XML4JErrors"> + <MsgDomain Domain="http://apache.org/xml/messages/XMLDOMMsg"> <FatalError> - <Message Id="BadMajorCode" Text="The majorCode parameter to createMessage was out of bounds"/> - <Message Id="MessageFormatFailure" Text="An internal error occurred while formatting the following message:"/> - <Message Id="UnterminatedPEReference" Text="The parameter entity reference must end with the ';' delimiter."/> - <Message Id="ExternalIDRequired" Text="The external entity declaration must begin with either SYSTEM or PUBLIC"/> - <Message Id="RecursiveReference" Text="Recursive reference {0} (Reference path: '{1}')"/> - <Message Id="ImproperDeclarationNesting" Text="The replacement text of parameter entity '{0}' must be properly nested"/> - <Message Id="ErrorMessageAvailable" Text="There is a message available for this error."/> - <Message Id="IncompleteContent" Text="The content is not complete for element '{0}'"/> - <Message Id="UnterminatedSystemID" Text="Expected a termination character for the system id."/> - <Message Id="UnterminatedPublicID" Text="Expected a termination character for the public id."/> - <Message Id="UnterminatedEnumeration" Text="Expected a termination character for the enumeration."/> - <Message Id="CDEndInContent" Text="Expected a CD end in the content section."/> - <Message Id="TwoColonsInQName" Text="Expected two colons, '::', in the Q Name."/> - <Message Id="MarkupNotRecognized" Text="Markup tags are not recognized."/> - <Message Id="URIFragmentInSystemId" Text="URI Fragment found in System Id"/> - <Message Id="ElementTypeReqInElementDecl" Text="Expected a element type in the element declaration."/> - <Message Id="UnterminatedAttributeValue" Text="Expected a termination character for the attribute value."/> - <Message Id="MaximumCodeReached" Text="The maximum size for code has been reached."/> +<!--The following are DOMException error text, same order as DOMException::ExceptionCode enum --> + <Message Id="INDEX_SIZE_ERR" Text="The index or size is negative, or greater than the allowed value"/> + <Message Id="DOMSTRING_SIZE_ERR" Text="The specified range of text does not fit into the String"/> + <Message Id="HIERARCHY_REQUEST_ERR" Text="An attempt was made to insert a node where it is not permitted"/> + <Message Id="WRONG_DOCUMENT_ERR" Text="A node is used in a different document than the one that created it"/> + <Message Id="INVALID_CHARACTER_ERR" Text="An invalid or illegal XML character is specified"/> + <Message Id="NO_DATA_ALLOWED_ERR" Text="Data is specified for a node which does not support data"/> + <Message Id="NO_MODIFICATION_ALLOWED_ERR" Text="An attempt is made to modify an object where modifications are not allowed"/> + <Message Id="NOT_FOUND_ERR" Text="An attempt is made to reference a node in a context where it does not exist"/> + <Message Id="NOT_SUPPORTED_ERR" Text="The implementation does not support the requested type of object or operation"/> + <Message Id="INUSE_ATTRIBUTE_ERR" Text="An attempt is made to add an attribute that is already in use elsewhere"/> + <Message Id="INVALID_STATE_ERR " Text="A parameter or an operation is not supported by the underlying object"/> + <Message Id="SYNTAX_ERR" Text="An invalid or illegal string is specified"/> + <Message Id="INVALID_MODIFICATION_ERR" Text="An attempt is made to modify the type of the underlying object"/> + <Message Id="NAMESPACE_ERR" Text="An attempt is made to create or change an object in a way which is incorrect with regard to namespaces"/> + <Message Id="INVALID_ACCESS_ERR" Text="An attempt is made to use an object that is not, or is no longer, usable"/> + <Message Id="VALIDATION_ERR" Text="A call to a method such as insertBefore or removeChild would make the Node invalid with respect to document grammar"/> +<!--The following are DOMRangeException error text, reverse order as DOMRangeException::RangeExceptionCode enum --> + <Message Id="INVALID_NODE_TYPE_ERR" Text="The container of a boundary-point of a Range is being set to either a node of an invalid type or a node with an ancestor of an invalid type"/> + <Message Id="BAD_BOUNDARYPOINTS_ERR" Text="The boundary-points of a Range do not meet specific requirements"/> </FatalError> </MsgDomain> </MsgFile> diff --git a/src/xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp b/src/xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp index a60bb68a4..c3de93597 100644 --- a/src/xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp +++ b/src/xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.7 2002/11/12 17:27:49 tng + * DOM Message: add new domain for DOM Messages. + * * Revision 1.6 2002/11/04 22:24:43 peiyongz * Locale setting for message loader * @@ -140,6 +143,7 @@ ICUMsgLoader::ICUMsgLoader(const XMLCh* const msgDomain) ***/ if (!XMLString::equals(msgDomain, XMLUni::fgXMLErrDomain) && !XMLString::equals(msgDomain, XMLUni::fgExceptDomain) && + !XMLString::equals(msgDomain, XMLUni::fgXMLDOMMsgDomain) && !XMLString::equals(msgDomain, XMLUni::fgValidityDomain) ) { XMLPlatformUtils::panic(XMLPlatformUtils::Panic_UnknownMsgDomain); @@ -157,8 +161,8 @@ ICUMsgLoader::ICUMsgLoader(const XMLCh* const msgDomain) REVISIT: another approach would be: through some system API which returns the directory of the XercescLib and - that directory would be used to locate the - resource bundle + that directory would be used to locate the + resource bundle ***/ char locationBuf[1024]; memset(locationBuf, 0, sizeof locationBuf); @@ -188,7 +192,7 @@ ICUMsgLoader::ICUMsgLoader(const XMLCh* const msgDomain) ***/ err = U_ZERO_ERROR; fDomainBundle = ures_getByKey(fLocaleBundle, domainName, NULL, &err); - + if (!U_SUCCESS(err) || fDomainBundle == NULL) { XMLPlatformUtils::panic(XMLPlatformUtils::Panic_CantLoadMsgDomain); diff --git a/src/xercesc/util/MsgLoaders/ICU/resources/en_US.txt b/src/xercesc/util/MsgLoaders/ICU/resources/en_US.txt index f5097ae21..e61aae5ed 100644 --- a/src/xercesc/util/MsgLoaders/ICU/resources/en_US.txt +++ b/src/xercesc/util/MsgLoaders/ICU/resources/en_US.txt @@ -291,6 +291,8 @@ en_US { "The schemaLocation attribute does not contain pairs of values. " , "Internal error: don't have a GrammarResolver for TraverseSchema " , "Fatal error encountered during schema scan " , + "Reference to external entity declaration '{0}' is not allowed in a standalone document. " , + "Partial markup in parameter entity replacement text in a complete declaration. " , "F End " , } @@ -298,7 +300,7 @@ en_US { // an array XMLValidity { "E Start " , - "en_US, Unknown element '{0}' " , + "Unknown element '{0}' " , "Attribute '{0}' not defined " , "Notation '{0}' was referenced but never declared " , "Root element different from DOCTYPE " , @@ -768,5 +770,30 @@ en_US { "F End " , } + + // an array + XMLDOMMsg { + "F Start " , + "The index or size is negative, or greater than the allowed value " , + "The specified range of text does not fit into the String " , + "An attempt was made to insert a node where it is not permitted " , + "A node is used in a different document than the one that created it " , + "An invalid or illegal XML character is specified " , + "Data is specified for a node which does not support data " , + "An attempt is made to modify an object where modifications are not allowed " , + "An attempt is made to reference a node in a context where it does not exist " , + "The implementation does not support the requested type of object or operation " , + "An attempt is made to add an attribute that is already in use elsewhere " , + "A parameter or an operation is not supported by the underlying object " , + "An invalid or illegal string is specified " , + "An attempt is made to modify the type of the underlying object " , + "An attempt is made to create or change an object in a way which is incorrect with regard to namespaces " , + "An attempt is made to use an object that is not, or is no longer, usable " , + "A call to a method such as insertBefore or removeChild would make the Node invalid with respect to document grammar " , + "The container of a boundary-point of a Range is being set to either a node of an invalid type or a node with an ancestor of an invalid type " , + "The boundary-points of a Range do not meet specific requirements " , + "F End " , + } + } diff --git a/src/xercesc/util/MsgLoaders/InMemory/CppErrMsgs_EN_US.hpp b/src/xercesc/util/MsgLoaders/InMemory/CppErrMsgs_EN_US.hpp index 03f2b55c5..b3ea6b8d2 100644 --- a/src/xercesc/util/MsgLoaders/InMemory/CppErrMsgs_EN_US.hpp +++ b/src/xercesc/util/MsgLoaders/InMemory/CppErrMsgs_EN_US.hpp @@ -1516,5 +1516,59 @@ const XMLCh gXMLExceptArray[][128] = }; const unsigned int gXMLExceptArraySize = 360; +const XMLCh gXMLDOMMsgArray[][128] = +{ + { 0x0046,0x005F,0x0053,0x0074,0x0061,0x0072,0x0074,0x00 } + , { 0x0054,0x0068,0x0065,0x0020,0x0069,0x006E,0x0064,0x0065,0x0078,0x0020,0x006F,0x0072,0x0020,0x0073,0x0069,0x007A,0x0065,0x0020,0x0069,0x0073,0x0020,0x006E,0x0065,0x0067,0x0061,0x0074,0x0069,0x0076,0x0065,0x002C,0x0020,0x006F,0x0072,0x0020,0x0067, + 0x0072,0x0065,0x0061,0x0074,0x0065,0x0072,0x0020,0x0074,0x0068,0x0061,0x006E,0x0020,0x0074,0x0068,0x0065,0x0020,0x0061,0x006C,0x006C,0x006F,0x0077,0x0065,0x0064,0x0020,0x0076,0x0061,0x006C,0x0075,0x0065,0x00 } + , { 0x0054,0x0068,0x0065,0x0020,0x0073,0x0070,0x0065,0x0063,0x0069,0x0066,0x0069,0x0065,0x0064,0x0020,0x0072,0x0061,0x006E,0x0067,0x0065,0x0020,0x006F,0x0066,0x0020,0x0074,0x0065,0x0078,0x0074,0x0020,0x0064,0x006F,0x0065,0x0073,0x0020,0x006E,0x006F, + 0x0074,0x0020,0x0066,0x0069,0x0074,0x0020,0x0069,0x006E,0x0074,0x006F,0x0020,0x0074,0x0068,0x0065,0x0020,0x0053,0x0074,0x0072,0x0069,0x006E,0x0067,0x00 } + , { 0x0041,0x006E,0x0020,0x0061,0x0074,0x0074,0x0065,0x006D,0x0070,0x0074,0x0020,0x0077,0x0061,0x0073,0x0020,0x006D,0x0061,0x0064,0x0065,0x0020,0x0074,0x006F,0x0020,0x0069,0x006E,0x0073,0x0065,0x0072,0x0074,0x0020,0x0061,0x0020,0x006E,0x006F,0x0064, + 0x0065,0x0020,0x0077,0x0068,0x0065,0x0072,0x0065,0x0020,0x0069,0x0074,0x0020,0x0069,0x0073,0x0020,0x006E,0x006F,0x0074,0x0020,0x0070,0x0065,0x0072,0x006D,0x0069,0x0074,0x0074,0x0065,0x0064,0x00 } + , { 0x0041,0x0020,0x006E,0x006F,0x0064,0x0065,0x0020,0x0069,0x0073,0x0020,0x0075,0x0073,0x0065,0x0064,0x0020,0x0069,0x006E,0x0020,0x0061,0x0020,0x0064,0x0069,0x0066,0x0066,0x0065,0x0072,0x0065,0x006E,0x0074,0x0020,0x0064,0x006F,0x0063,0x0075,0x006D, + 0x0065,0x006E,0x0074,0x0020,0x0074,0x0068,0x0061,0x006E,0x0020,0x0074,0x0068,0x0065,0x0020,0x006F,0x006E,0x0065,0x0020,0x0074,0x0068,0x0061,0x0074,0x0020,0x0063,0x0072,0x0065,0x0061,0x0074,0x0065,0x0064,0x0020,0x0069,0x0074,0x00 } + , { 0x0041,0x006E,0x0020,0x0069,0x006E,0x0076,0x0061,0x006C,0x0069,0x0064,0x0020,0x006F,0x0072,0x0020,0x0069,0x006C,0x006C,0x0065,0x0067,0x0061,0x006C,0x0020,0x0058,0x004D,0x004C,0x0020,0x0063,0x0068,0x0061,0x0072,0x0061,0x0063,0x0074,0x0065,0x0072, + 0x0020,0x0069,0x0073,0x0020,0x0073,0x0070,0x0065,0x0063,0x0069,0x0066,0x0069,0x0065,0x0064,0x00 } + , { 0x0044,0x0061,0x0074,0x0061,0x0020,0x0069,0x0073,0x0020,0x0073,0x0070,0x0065,0x0063,0x0069,0x0066,0x0069,0x0065,0x0064,0x0020,0x0066,0x006F,0x0072,0x0020,0x0061,0x0020,0x006E,0x006F,0x0064,0x0065,0x0020,0x0077,0x0068,0x0069,0x0063,0x0068,0x0020, + 0x0064,0x006F,0x0065,0x0073,0x0020,0x006E,0x006F,0x0074,0x0020,0x0073,0x0075,0x0070,0x0070,0x006F,0x0072,0x0074,0x0020,0x0064,0x0061,0x0074,0x0061,0x00 } + , { 0x0041,0x006E,0x0020,0x0061,0x0074,0x0074,0x0065,0x006D,0x0070,0x0074,0x0020,0x0069,0x0073,0x0020,0x006D,0x0061,0x0064,0x0065,0x0020,0x0074,0x006F,0x0020,0x006D,0x006F,0x0064,0x0069,0x0066,0x0079,0x0020,0x0061,0x006E,0x0020,0x006F,0x0062,0x006A, + 0x0065,0x0063,0x0074,0x0020,0x0077,0x0068,0x0065,0x0072,0x0065,0x0020,0x006D,0x006F,0x0064,0x0069,0x0066,0x0069,0x0063,0x0061,0x0074,0x0069,0x006F,0x006E,0x0073,0x0020,0x0061,0x0072,0x0065,0x0020,0x006E,0x006F,0x0074,0x0020,0x0061,0x006C,0x006C, + 0x006F,0x0077,0x0065,0x0064,0x00 } + , { 0x0041,0x006E,0x0020,0x0061,0x0074,0x0074,0x0065,0x006D,0x0070,0x0074,0x0020,0x0069,0x0073,0x0020,0x006D,0x0061,0x0064,0x0065,0x0020,0x0074,0x006F,0x0020,0x0072,0x0065,0x0066,0x0065,0x0072,0x0065,0x006E,0x0063,0x0065,0x0020,0x0061,0x0020,0x006E, + 0x006F,0x0064,0x0065,0x0020,0x0069,0x006E,0x0020,0x0061,0x0020,0x0063,0x006F,0x006E,0x0074,0x0065,0x0078,0x0074,0x0020,0x0077,0x0068,0x0065,0x0072,0x0065,0x0020,0x0069,0x0074,0x0020,0x0064,0x006F,0x0065,0x0073,0x0020,0x006E,0x006F,0x0074,0x0020, + 0x0065,0x0078,0x0069,0x0073,0x0074,0x00 } + , { 0x0054,0x0068,0x0065,0x0020,0x0069,0x006D,0x0070,0x006C,0x0065,0x006D,0x0065,0x006E,0x0074,0x0061,0x0074,0x0069,0x006F,0x006E,0x0020,0x0064,0x006F,0x0065,0x0073,0x0020,0x006E,0x006F,0x0074,0x0020,0x0073,0x0075,0x0070,0x0070,0x006F,0x0072,0x0074, + 0x0020,0x0074,0x0068,0x0065,0x0020,0x0072,0x0065,0x0071,0x0075,0x0065,0x0073,0x0074,0x0065,0x0064,0x0020,0x0074,0x0079,0x0070,0x0065,0x0020,0x006F,0x0066,0x0020,0x006F,0x0062,0x006A,0x0065,0x0063,0x0074,0x0020,0x006F,0x0072,0x0020,0x006F,0x0070, + 0x0065,0x0072,0x0061,0x0074,0x0069,0x006F,0x006E,0x00 } + , { 0x0041,0x006E,0x0020,0x0061,0x0074,0x0074,0x0065,0x006D,0x0070,0x0074,0x0020,0x0069,0x0073,0x0020,0x006D,0x0061,0x0064,0x0065,0x0020,0x0074,0x006F,0x0020,0x0061,0x0064,0x0064,0x0020,0x0061,0x006E,0x0020,0x0061,0x0074,0x0074,0x0072,0x0069,0x0062, + 0x0075,0x0074,0x0065,0x0020,0x0074,0x0068,0x0061,0x0074,0x0020,0x0069,0x0073,0x0020,0x0061,0x006C,0x0072,0x0065,0x0061,0x0064,0x0079,0x0020,0x0069,0x006E,0x0020,0x0075,0x0073,0x0065,0x0020,0x0065,0x006C,0x0073,0x0065,0x0077,0x0068,0x0065,0x0072, + 0x0065,0x00 } + , { 0x0041,0x0020,0x0070,0x0061,0x0072,0x0061,0x006D,0x0065,0x0074,0x0065,0x0072,0x0020,0x006F,0x0072,0x0020,0x0061,0x006E,0x0020,0x006F,0x0070,0x0065,0x0072,0x0061,0x0074,0x0069,0x006F,0x006E,0x0020,0x0069,0x0073,0x0020,0x006E,0x006F,0x0074,0x0020, + 0x0073,0x0075,0x0070,0x0070,0x006F,0x0072,0x0074,0x0065,0x0064,0x0020,0x0062,0x0079,0x0020,0x0074,0x0068,0x0065,0x0020,0x0075,0x006E,0x0064,0x0065,0x0072,0x006C,0x0079,0x0069,0x006E,0x0067,0x0020,0x006F,0x0062,0x006A,0x0065,0x0063,0x0074,0x00 } + , { 0x0041,0x006E,0x0020,0x0069,0x006E,0x0076,0x0061,0x006C,0x0069,0x0064,0x0020,0x006F,0x0072,0x0020,0x0069,0x006C,0x006C,0x0065,0x0067,0x0061,0x006C,0x0020,0x0073,0x0074,0x0072,0x0069,0x006E,0x0067,0x0020,0x0069,0x0073,0x0020,0x0073,0x0070,0x0065, + 0x0063,0x0069,0x0066,0x0069,0x0065,0x0064,0x00 } + , { 0x0041,0x006E,0x0020,0x0061,0x0074,0x0074,0x0065,0x006D,0x0070,0x0074,0x0020,0x0069,0x0073,0x0020,0x006D,0x0061,0x0064,0x0065,0x0020,0x0074,0x006F,0x0020,0x006D,0x006F,0x0064,0x0069,0x0066,0x0079,0x0020,0x0074,0x0068,0x0065,0x0020,0x0074,0x0079, + 0x0070,0x0065,0x0020,0x006F,0x0066,0x0020,0x0074,0x0068,0x0065,0x0020,0x0075,0x006E,0x0064,0x0065,0x0072,0x006C,0x0079,0x0069,0x006E,0x0067,0x0020,0x006F,0x0062,0x006A,0x0065,0x0063,0x0074,0x00 } + , { 0x0041,0x006E,0x0020,0x0061,0x0074,0x0074,0x0065,0x006D,0x0070,0x0074,0x0020,0x0069,0x0073,0x0020,0x006D,0x0061,0x0064,0x0065,0x0020,0x0074,0x006F,0x0020,0x0063,0x0072,0x0065,0x0061,0x0074,0x0065,0x0020,0x006F,0x0072,0x0020,0x0063,0x0068,0x0061, + 0x006E,0x0067,0x0065,0x0020,0x0061,0x006E,0x0020,0x006F,0x0062,0x006A,0x0065,0x0063,0x0074,0x0020,0x0069,0x006E,0x0020,0x0061,0x0020,0x0077,0x0061,0x0079,0x0020,0x0077,0x0068,0x0069,0x0063,0x0068,0x0020,0x0069,0x0073,0x0020,0x0069,0x006E,0x0063, + 0x006F,0x0072,0x0072,0x0065,0x0063,0x0074,0x0020,0x0077,0x0069,0x0074,0x0068,0x0020,0x0072,0x0065,0x0067,0x0061,0x0072,0x0064,0x0020,0x0074,0x006F,0x0020,0x006E,0x0061,0x006D,0x0065,0x0073,0x0070,0x0061,0x0063,0x0065,0x0073,0x00 } + , { 0x0041,0x006E,0x0020,0x0061,0x0074,0x0074,0x0065,0x006D,0x0070,0x0074,0x0020,0x0069,0x0073,0x0020,0x006D,0x0061,0x0064,0x0065,0x0020,0x0074,0x006F,0x0020,0x0075,0x0073,0x0065,0x0020,0x0061,0x006E,0x0020,0x006F,0x0062,0x006A,0x0065,0x0063,0x0074, + 0x0020,0x0074,0x0068,0x0061,0x0074,0x0020,0x0069,0x0073,0x0020,0x006E,0x006F,0x0074,0x002C,0x0020,0x006F,0x0072,0x0020,0x0069,0x0073,0x0020,0x006E,0x006F,0x0020,0x006C,0x006F,0x006E,0x0067,0x0065,0x0072,0x002C,0x0020,0x0075,0x0073,0x0061,0x0062, + 0x006C,0x0065,0x00 } + , { 0x0041,0x0020,0x0063,0x0061,0x006C,0x006C,0x0020,0x0074,0x006F,0x0020,0x0061,0x0020,0x006D,0x0065,0x0074,0x0068,0x006F,0x0064,0x0020,0x0073,0x0075,0x0063,0x0068,0x0020,0x0061,0x0073,0x0020,0x0069,0x006E,0x0073,0x0065,0x0072,0x0074,0x0042,0x0065, + 0x0066,0x006F,0x0072,0x0065,0x0020,0x006F,0x0072,0x0020,0x0072,0x0065,0x006D,0x006F,0x0076,0x0065,0x0043,0x0068,0x0069,0x006C,0x0064,0x0020,0x0077,0x006F,0x0075,0x006C,0x0064,0x0020,0x006D,0x0061,0x006B,0x0065,0x0020,0x0074,0x0068,0x0065,0x0020, + 0x004E,0x006F,0x0064,0x0065,0x0020,0x0069,0x006E,0x0076,0x0061,0x006C,0x0069,0x0064,0x0020,0x0077,0x0069,0x0074,0x0068,0x0020,0x0072,0x0065,0x0073,0x0070,0x0065,0x0063,0x0074,0x0020,0x0074,0x006F,0x0020,0x0064,0x006F,0x0063,0x0075,0x006D,0x0065, + 0x006E,0x0074,0x0020,0x0067,0x0072,0x0061,0x006D,0x006D,0x0061,0x0072,0x00 } + , { 0x0054,0x0068,0x0065,0x0020,0x0063,0x006F,0x006E,0x0074,0x0061,0x0069,0x006E,0x0065,0x0072,0x0020,0x006F,0x0066,0x0020,0x0061,0x0020,0x0062,0x006F,0x0075,0x006E,0x0064,0x0061,0x0072,0x0079,0x002D,0x0070,0x006F,0x0069,0x006E,0x0074,0x0020,0x006F, + 0x0066,0x0020,0x0061,0x0020,0x0052,0x0061,0x006E,0x0067,0x0065,0x0020,0x0069,0x0073,0x0020,0x0062,0x0065,0x0069,0x006E,0x0067,0x0020,0x0073,0x0065,0x0074,0x0020,0x0074,0x006F,0x0020,0x0065,0x0069,0x0074,0x0068,0x0065,0x0072,0x0020,0x0061,0x0020, + 0x006E,0x006F,0x0064,0x0065,0x0020,0x006F,0x0066,0x0020,0x0061,0x006E,0x0020,0x0069,0x006E,0x0076,0x0061,0x006C,0x0069,0x0064,0x0020,0x0074,0x0079,0x0070,0x0065,0x0020,0x006F,0x0072,0x0020,0x0061,0x0020,0x006E,0x006F,0x0064,0x0065,0x0020,0x0077, + 0x0069,0x0074,0x0068,0x0020,0x0061,0x006E,0x0020,0x0061,0x006E,0x0063,0x0065,0x0073,0x0074,0x006F,0x0072,0x0020,0x006F,0x0066,0x0020,0x0061,0x006E,0x0020,0x0069,0x006E,0x0076,0x0061,0x006C,0x0069,0x0064,0x0020,0x0074,0x0079,0x0070,0x0065,0x00 } + , { 0x0054,0x0068,0x0065,0x0020,0x0062,0x006F,0x0075,0x006E,0x0064,0x0061,0x0072,0x0079,0x002D,0x0070,0x006F,0x0069,0x006E,0x0074,0x0073,0x0020,0x006F,0x0066,0x0020,0x0061,0x0020,0x0052,0x0061,0x006E,0x0067,0x0065,0x0020,0x0064,0x006F,0x0020,0x006E, + 0x006F,0x0074,0x0020,0x006D,0x0065,0x0065,0x0074,0x0020,0x0073,0x0070,0x0065,0x0063,0x0069,0x0066,0x0069,0x0063,0x0020,0x0072,0x0065,0x0071,0x0075,0x0069,0x0072,0x0065,0x006D,0x0065,0x006E,0x0074,0x0073,0x00 } + , { 0x0046,0x005F,0x0045,0x006E,0x0064,0x00 } + +}; +const unsigned int gXMLDOMMsgArraySize = 25; + XERCES_CPP_NAMESPACE_END diff --git a/src/xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp b/src/xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp index d008d9395..579107db3 100644 --- a/src/xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp +++ b/src/xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.5 2002/11/12 17:26:53 tng + * DOM Message: add new domain for DOM Messages. + * * Revision 1.4 2002/11/04 15:10:40 tng * C++ Namespace Support. * @@ -114,6 +117,7 @@ InMemMsgLoader::InMemMsgLoader(const XMLCh* const msgDomain) { if (!XMLString::equals(msgDomain, XMLUni::fgXMLErrDomain) && !XMLString::equals(msgDomain, XMLUni::fgExceptDomain) + && !XMLString::equals(msgDomain, XMLUni::fgXMLDOMMsgDomain) && !XMLString::equals(msgDomain, XMLUni::fgValidityDomain)) { XMLPlatformUtils::panic(XMLPlatformUtils::Panic_UnknownMsgDomain); @@ -167,6 +171,13 @@ bool InMemMsgLoader::loadMsg(const XMLMsgLoader::XMLMsgId msgToLoad else srcPtr = gXMLValidityArray[msgToLoad - 1]; } + else if (XMLString::equals(fMsgDomain, XMLUni::fgXMLDOMMsgDomain)) + { + if ( msgToLoad > gXMLDOMMsgArraySize) + return false; + else + srcPtr = gXMLDOMMsgArray[msgToLoad - 1]; + } while (*srcPtr && (outPtr < endPtr)) { diff --git a/src/xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.cpp b/src/xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.cpp index 38dc7eca7..0a8170944 100644 --- a/src/xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.cpp +++ b/src/xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.cpp @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.7 2002/11/12 17:27:12 tng + * DOM Message: add new domain for DOM Messages. + * * Revision 1.6 2002/11/05 16:54:46 peiyongz * Using XERCESC_NLS_HOME * @@ -131,6 +134,7 @@ MsgCatalogLoader::MsgCatalogLoader(const XMLCh* const msgDomain) { if (!XMLString::equals(msgDomain, XMLUni::fgXMLErrDomain) && !XMLString::equals(msgDomain, XMLUni::fgExceptDomain) + && !XMLString::equals(msgDomain, XMLUni::fgXMLDOMMsgDomain) && !XMLString::equals(msgDomain, XMLUni::fgValidityDomain)) { XMLPlatformUtils::panic(XMLPlatformUtils::Panic_UnknownMsgDomain); @@ -166,6 +170,8 @@ MsgCatalogLoader::MsgCatalogLoader(const XMLCh* const msgDomain) fMsgSet = CatId_XMLExcepts; else if (XMLString::equals(msgDomain, XMLUni::fgValidityDomain)) fMsgSet = CatId_XMLValid; + else if (XMLString::equals(msgDomain, XMLUni::fgXMLDOMMsgDomain)) + fMsgSet = CatId_XMLDOMMsg; } MsgCatalogLoader::~MsgCatalogLoader() diff --git a/src/xercesc/util/MsgLoaders/MsgCatalog/XMLMsgCat_EN_US.Msg b/src/xercesc/util/MsgLoaders/MsgCatalog/XMLMsgCat_EN_US.Msg index abeb19a06..58eacc7cb 100644 --- a/src/xercesc/util/MsgLoaders/MsgCatalog/XMLMsgCat_EN_US.Msg +++ b/src/xercesc/util/MsgLoaders/MsgCatalog/XMLMsgCat_EN_US.Msg @@ -752,3 +752,24 @@ $set 3 356 NodeIDMap overflows and exceeds the largest available size +$set 4 +2 The index or size is negative, or greater than the allowed value +3 The specified range of text does not fit into the String +4 An attempt was made to insert a node where it is not permitted +5 A node is used in a different document than the one that created it +6 An invalid or illegal XML character is specified +7 Data is specified for a node which does not support data +8 An attempt is made to modify an object where modifications are not allowed +9 An attempt is made to reference a node in a context where it does not exist +10 The implementation does not support the requested type of object or operation +11 An attempt is made to add an attribute that is already in use elsewhere +12 A parameter or an operation is not supported by the underlying object +13 An invalid or illegal string is specified +14 An attempt is made to modify the type of the underlying object +15 An attempt is made to create or change an object in a way which is incorrect with regard to namespaces +16 An attempt is made to use an object that is not, or is no longer, usable +17 A call to a method such as insertBefore or removeChild would make the Node invalid with respect to document grammar +18 The container of a boundary-point of a Range is being set to either a node of an invalid type or a node with an ancestor of an invalid type +19 The boundary-points of a Range do not meet specific requirements + + diff --git a/src/xercesc/util/MsgLoaders/MsgCatalog/XMLMsgCat_Ids.hpp b/src/xercesc/util/MsgLoaders/MsgCatalog/XMLMsgCat_Ids.hpp index d4ea02d70..f28a20ac5 100644 --- a/src/xercesc/util/MsgLoaders/MsgCatalog/XMLMsgCat_Ids.hpp +++ b/src/xercesc/util/MsgLoaders/MsgCatalog/XMLMsgCat_Ids.hpp @@ -10,6 +10,7 @@ XERCES_CPP_NAMESPACE_BEGIN const unsigned int CatId_XMLErrs = 1; const unsigned int CatId_XMLValid = 2; const unsigned int CatId_XMLExcepts = 3; +const unsigned int CatId_XMLDOMMsg = 4; XERCES_CPP_NAMESPACE_END diff --git a/src/xercesc/util/MsgLoaders/MsgFile/MsgLoader.cpp b/src/xercesc/util/MsgLoaders/MsgFile/MsgLoader.cpp index 3dad2e94f..cb9e1627d 100644 --- a/src/xercesc/util/MsgLoaders/MsgFile/MsgLoader.cpp +++ b/src/xercesc/util/MsgLoaders/MsgFile/MsgLoader.cpp @@ -206,15 +206,17 @@ bool MsgCatalogLoader::loadMsg(const XMLMsgLoader::XMLMsgId msgToLoad int size = 0; if (XMLString::equals(fMsgDomain, XMLUni::fgXMLErrDomain)) { - if(msgToLoad < 7) // Warning messages - msgId = Warnings[msgToLoad - 2]; - else // Fatal Errors - msgId = Errors[msgToLoad - 9]; + if(msgToLoad < 7) // Warning messages + msgId = Warnings[msgToLoad - 2]; + else // Fatal Errors + msgId = Errors[msgToLoad - 9]; } else if (XMLString::equals(fMsgDomain, XMLUni::fgExceptDomain)) msgId = Exceptions[msgToLoad - 2]; else if (XMLString::equals(fMsgDomain, XMLUni::fgValidityDomain)) - msgId = Invalid[msgToLoad - 2]; + msgId = Invalid[msgToLoad - 2]; + else if (XMLString::equals(fMsgDomain, XMLUni::fgXMLDOMMsgDomain)) + msgId = DOMMsg[msgToLoad - 2]; if (!localMsg(msgId, toFill, maxChars, repTexts, size)) return false; @@ -236,15 +238,17 @@ bool MsgCatalogLoader::loadMsg(const XMLMsgLoader::XMLMsgId msgToLoad char* repTexts = PackingRepText(repText1, repText2, repText3, repText4, size); if (XMLString::equals(fMsgDomain, XMLUni::fgXMLErrDomain)) { - if(msgToLoad < 7) - msgId = Warnings[msgToLoad - 2]; - else - msgId = Errors[msgToLoad - 9]; + if(msgToLoad < 7) + msgId = Warnings[msgToLoad - 2]; + else + msgId = Errors[msgToLoad - 9]; } else if (XMLString::equals(fMsgDomain, XMLUni::fgExceptDomain)) msgId = Exceptions[msgToLoad - 2]; else if (XMLString::equals(fMsgDomain, XMLUni::fgValidityDomain)) - msgId = Invalid[msgToLoad - 2]; + msgId = Invalid[msgToLoad - 2]; + else if (XMLString::equals(fMsgDomain, XMLUni::fgXMLDOMMsgDomain)) + msgId = DOMMsg[msgToLoad - 2]; // Call the other version to load up the message if (!localMsg(msgId, toFill, maxChars, repTexts, size)) diff --git a/src/xercesc/util/MsgLoaders/Win32/Win32MsgLoader.cpp b/src/xercesc/util/MsgLoaders/Win32/Win32MsgLoader.cpp index 52bcae4af..fdd2f7bef 100644 --- a/src/xercesc/util/MsgLoaders/Win32/Win32MsgLoader.cpp +++ b/src/xercesc/util/MsgLoaders/Win32/Win32MsgLoader.cpp @@ -134,6 +134,8 @@ Win32MsgLoader::Win32MsgLoader(const XMLCh* const msgDomain) : fDomainOfs = 0x2000; else if (XMLString::equals(fMsgDomain, XMLUni::fgValidityDomain)) fDomainOfs = 0x4000; + else if (XMLString::equals(fMsgDomain, XMLUni::fgXMLDOMMsgDomain)) + fDomainOfs = 0x6000; else XMLPlatformUtils::panic(XMLPlatformUtils::Panic_UnknownMsgDomain); } diff --git a/src/xercesc/util/XMLDOMMsg.hpp b/src/xercesc/util/XMLDOMMsg.hpp new file mode 100644 index 000000000..c17797c99 --- /dev/null +++ b/src/xercesc/util/XMLDOMMsg.hpp @@ -0,0 +1,73 @@ +// This file is generated, don't edit it!! + +#if !defined(ERRHEADER_XMLDOMMsg) +#define ERRHEADER_XMLDOMMsg + +#include <xercesc/framework/XMLErrorReporter.hpp> +#include <xercesc/util/XercesDefs.hpp> + +XERCES_CPP_NAMESPACE_BEGIN + +class XMLDOMMsg +{ +public : + enum Codes + { + NoError = 0 + , F_LowBounds = 1 + , INDEX_SIZE_ERR = 2 + , DOMSTRING_SIZE_ERR = 3 + , HIERARCHY_REQUEST_ERR = 4 + , WRONG_DOCUMENT_ERR = 5 + , INVALID_CHARACTER_ERR = 6 + , NO_DATA_ALLOWED_ERR = 7 + , NO_MODIFICATION_ALLOWED_ERR = 8 + , NOT_FOUND_ERR = 9 + , NOT_SUPPORTED_ERR = 10 + , INUSE_ATTRIBUTE_ERR = 11 + , INVALID_STATE_ERR = 12 + , SYNTAX_ERR = 13 + , INVALID_MODIFICATION_ERR = 14 + , NAMESPACE_ERR = 15 + , INVALID_ACCESS_ERR = 16 + , VALIDATION_ERR = 17 + , INVALID_NODE_TYPE_ERR = 18 + , BAD_BOUNDARYPOINTS_ERR = 19 + , F_HighBounds = 20 + , W_LowBounds = 21 + , W_HighBounds = 22 + , E_LowBounds = 23 + , E_HighBounds = 24 + }; + + static bool isFatal(const XMLDOMMsg::Codes toCheck) + { + return ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds)); + } + + static bool isWarning(const XMLDOMMsg::Codes toCheck) + { + return ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds)); + } + + static bool isError(const XMLDOMMsg::Codes toCheck) + { + return ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds)); + } + + static XMLErrorReporter::ErrTypes errorType(const XMLDOMMsg::Codes toCheck) + { + if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds)) + return XMLErrorReporter::ErrType_Warning; + else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds)) + return XMLErrorReporter::ErrType_Fatal; + else if ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds)) + return XMLErrorReporter::ErrType_Error; + return XMLErrorReporter::ErrTypes_Unknown; + } +}; + +XERCES_CPP_NAMESPACE_END + +#endif + diff --git a/src/xercesc/util/XMLUni.cpp b/src/xercesc/util/XMLUni.cpp index b6f8203f5..966faaecf 100644 --- a/src/xercesc/util/XMLUni.cpp +++ b/src/xercesc/util/XMLUni.cpp @@ -1202,5 +1202,20 @@ const XMLCh XMLUni::fgDOMWRTWhitespaceInElementContent[] = // en_US const char XMLUni::fgXercescDefaultLocale[] = "en_US"; +// DOM Message Domain +const XMLCh XMLUni::fgXMLDOMMsgDomain[] = +{ + chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash + , chForwardSlash, chLatin_a, chLatin_p, chLatin_a, chLatin_c + , chLatin_h, chLatin_e, chPeriod, chLatin_o, chLatin_r, chLatin_g + , chForwardSlash, chLatin_x, chLatin_m, chLatin_l, chForwardSlash + , chLatin_m, chLatin_e, chLatin_s, chLatin_s, chLatin_a, chLatin_g + , chLatin_e, chLatin_s, chForwardSlash, chLatin_X, chLatin_M, chLatin_L + , chLatin_D, chLatin_O, chLatin_M, chLatin_M, chLatin_s, chLatin_g + , chNull +}; + + + XERCES_CPP_NAMESPACE_END diff --git a/src/xercesc/util/XMLUni.hpp b/src/xercesc/util/XMLUni.hpp index 4a5cc3944..32ba99689 100644 --- a/src/xercesc/util/XMLUni.hpp +++ b/src/xercesc/util/XMLUni.hpp @@ -158,6 +158,7 @@ public : static const XMLCh fgValidityDomain[]; static const XMLCh fgWin1252EncodingString[]; static const XMLCh fgXMLChEncodingString[]; + static const XMLCh fgXMLDOMMsgDomain[]; static const XMLCh fgXMLString[]; static const XMLCh fgXMLStringSpace[]; static const XMLCh fgXMLStringHTab[]; diff --git a/tools/NLS/Xlat/Xlat.cpp b/tools/NLS/Xlat/Xlat.cpp index b7bc990a1..26583889f 100644 --- a/tools/NLS/Xlat/Xlat.cpp +++ b/tools/NLS/Xlat/Xlat.cpp @@ -57,6 +57,9 @@ /* * $Log$ + * Revision 1.15 2002/11/12 17:24:58 tng + * DOM Message: add new domain for DOM Messages. + * * Revision 1.14 2002/11/04 15:24:50 tng * C++ Namespace Support. * @@ -547,6 +550,11 @@ extern "C" int wmain(int argC, XMLCh** argV) { headerName = L"XMLExceptMsgs.hpp"; errNameSpace = L"XMLExcepts"; + } + else if (!XMLString::compareString(domainStr, XMLUni::fgXMLDOMMsgDomain)) + { + headerName = L"XMLDOMMsg.hpp"; + errNameSpace = L"XMLDOMMsg"; } else { diff --git a/tools/NLS/Xlat/Xlat_CppSrc.cpp b/tools/NLS/Xlat/Xlat_CppSrc.cpp index fc1a44052..1978b33ed 100644 --- a/tools/NLS/Xlat/Xlat_CppSrc.cpp +++ b/tools/NLS/Xlat/Xlat_CppSrc.cpp @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.7 2002/11/12 17:24:58 tng + * DOM Message: add new domain for DOM Messages. + * * Revision 1.6 2002/11/04 15:24:50 tng * C++ Namespace Support. * @@ -193,6 +196,10 @@ void CppSrcFormatter::startDomain( const XMLCh* const domainName else if (!XMLString::compareString(XMLUni::fgValidityDomain, domainName)) { fCurDomainName = L"gXMLValidityArray"; + } + else if (!XMLString::compareString(XMLUni::fgXMLDOMMsgDomain, domainName)) + { + fCurDomainName = L"gXMLDOMMsgArray"; } else { diff --git a/tools/NLS/Xlat/Xlat_Win32RC.cpp b/tools/NLS/Xlat/Xlat_Win32RC.cpp index 868c88932..6c4c8d6dc 100644 --- a/tools/NLS/Xlat/Xlat_Win32RC.cpp +++ b/tools/NLS/Xlat/Xlat_Win32RC.cpp @@ -1,37 +1,37 @@ /* * The Apache Software License, Version 1.1 - * + * * Copyright (c) 1999-2000 The Apache Software Foundation. All rights * reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * + * notice, this list of conditions and the following disclaimer. + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * + * * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: + * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. - * + * * 4. The names "Xerces" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this - * software without prior written permission. For written + * software without prior written permission. For written * permission, please contact apache\@apache.org. - * + * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. - * + * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -45,7 +45,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== - * + * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation, and was * originally based on software copyright (c) 1999, International @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.5 2002/11/12 17:24:58 tng + * DOM Message: add new domain for DOM Messages. + * * Revision 1.4 2000/03/02 19:55:54 roddey * This checkin includes many changes done while waiting for the * 1.1.0 code to be finished. I can't list them all here, but a list is @@ -166,6 +169,11 @@ void Win32RCFormatter::startDomain( const XMLCh* const domainName { fCurDomainName = L"gXMLValidityArray"; fMsgOffset = 0x4000; + } + else if (!XMLString::compareString(XMLUni::fgXMLDOMMsgDomain, domainName)) + { + fCurDomainName = L"gXMLDOMMsgArray"; + fMsgOffset = 0x6000; } else { -- GitLab