This is an automated email from the ASF dual-hosted git repository. scantor pushed a commit to branch xerces-3.3 in repository https://gitbox.apache.org/repos/asf/xerces-c.git
commit 516c7eea6e41b701050833780ad7c21138599027 Author: William S Fulton <w...@fultondesigns.co.uk> AuthorDate: Fri Aug 16 23:51:25 2024 +0100 NLS Xlat fixes and doc updates - Fixes for compiling with newer visual c++. - Update Xlat README file with missing information and corrections and to make regenerating the files easier by providing the actual copy commands for updating the code. --- tools/NLS/README | 59 +++++++++++++++++++++---------------------------- tools/NLS/Xlat/Xlat.cpp | 2 +- tools/NLS/Xlat/Xlat.hpp | 3 +++ 3 files changed, 29 insertions(+), 35 deletions(-) diff --git a/tools/NLS/README b/tools/NLS/README index cbdd7c919..6c4ab4980 100644 --- a/tools/NLS/README +++ b/tools/NLS/README @@ -3,42 +3,33 @@ on windows. Here are the steps: 1) Modify XMLErrList_EN_US.Xml as per the changes -2) Compile all the files in tools\NLS\Xlat and link them all into an - executable (Xlat.cpp has the main()) -3) Run this Xlat executable with parameter: - /SrcRoot=x:/xerces-c-src/ /OutPath=x:/output/ /OutFmt=KKK/Locale=EN_US +2) Build xerces with the CMake option: -Dxmlch-type=wchar_t and install it. +3) Using Visual C++, compile all the files in tools\NLS\Xlat and link them all into an + executable (Xlat.cpp has the main()). + i. You will need to set the include path to the <install location>\include. + ii. You will need to specify the library directory for linking to <install location>\lib. + iii. You will need to link to the appropriate xerces-c_*.lib file. +4) Set the PATH to <install location>\bin, that is, where xerces-c*.dll resides. + Then noting the parameters for passing to the Xlat executable: + /SrcRoot=x:/xerces-c/ /OutPath=x:/output/ /OutFmt=XXX /Locale=EN_US + (trailing slashes for the paths are required) where: - i. SrcRoot should point to XERCESCROOT - ii. OutPath should be any output folder that stores that generated - files - iii. Run it four times by setting OutFmt=Win32RC, OutFmt=CppSrc, - OutFmt=ResBundle, OutFmt=MsgCat, respectively + i. SrcRoot should point to XERCESCROOT, the root of the git repository. + ii. OutPath should be any output folder that stores the generated files and must already exist. + iii. Run the Xlat executable four times replacing /OutFmt=XXX with + /OutFmt=Win32RC, /OutFmt=CppSrc, /OutFmt=ResBundle, /OutFmt=MsgCat. -4) Then the following files will be generated, and must be copied to their - appropriate location: - i. en_US.txt - copy this file to - \src\xercesc\util\MsgLoaders\ICU\resources - ii. XercesMessages_en_US.hpp - copy this file to - \src\xercesc\util\MsgLoaders\InMemory - iii. XercesMessages_en_US.Msg - copy this file to - src\xercesc\util\MsgLoaders\MsgCatalog - iv. XMLDOMMsg.hpp - copy this file to src\xercesc\util - v. XMLErrorCodes.hpp - copy this file to src\xercesc\framework - vi. XMLExceptMsgs.hpp - copy this file to src\xercesc\util - vii. XMLMsgCat_Ids.hpp - copy this file to - src\xercesc\util\MsgLoaders\MsgCatalog - viii. XMLValidityCodes.hpp - copy this file to src\xercesc\framework - ix. CppErrMsgs_en_US.RC - copy the entire file and - replace the content - appearing between the line which reads: - #endif // APSTUDIO_INVOKED - and the line which reads: - #endif // English (U.S.) resources - in src\xercesc\util\MsgLoaders\Win32\version.rc - What you replace should begin with: - // ---------------------------------------------------------------- - // This file was generated from the XML error message source. - +5) Updated files will be generated and must be copied to their appropriate location. + Tweak the copy commands below replacing x:\xerces\ with the path given to /OutPath earlier: + + copy x:\output\root.txt src\xercesc\util\MsgLoaders\ICU\resources\root.txt + copy x:\output\XercesMessages_en_US.hpp src\xercesc\util\MsgLoaders\InMemory\XercesMessages_en_US.hpp + copy x:\output\XercesMessages_en_US.Msg src\xercesc\util\MsgLoaders\MsgCatalog\XercesMessages_en_US.Msg + copy x:\output\XMLDOMMsg.hpp src\xercesc\util\XMLDOMMsg.hpp + copy x:\output\XMLErrorCodes.hpp src\xercesc\framework\XMLErrorCodes.hpp + copy x:\output\XMLExceptMsgs.hpp src\xercesc\util\XMLExceptMsgs.hpp + copy x:\output\XMLMsgCat_Ids.hpp src\xercesc\util\MsgLoaders\MsgCatalog\XMLMsgCat_Ids.hpp + copy x:\output\XMLValidityCodes.hpp src\xercesc\framework\XMLValidityCodes.hpp Note: If you run Xlat on windows, and are commiting them under unix, you must first run dos2unix on them. diff --git a/tools/NLS/Xlat/Xlat.cpp b/tools/NLS/Xlat/Xlat.cpp index fc562db32..223e9962f 100644 --- a/tools/NLS/Xlat/Xlat.cpp +++ b/tools/NLS/Xlat/Xlat.cpp @@ -403,7 +403,7 @@ int Xlat_main(int argC, XMLCh** argV) { // Nest entire code in an inner block. - DOMDocument* srcDoc; + DOMDocument* srcDoc = NULL; const unsigned int bufSize = 4095; XMLCh *tmpFileBuf = new XMLCh [bufSize + 1]; tmpFileBuf[0] = 0; diff --git a/tools/NLS/Xlat/Xlat.hpp b/tools/NLS/Xlat/Xlat.hpp index 3f6ae7387..826c1e0e6 100644 --- a/tools/NLS/Xlat/Xlat.hpp +++ b/tools/NLS/Xlat/Xlat.hpp @@ -31,6 +31,9 @@ enum MsgTypes , MsgTypes_Count }; +#if defined(_MSC_VER) +#define _CRT_SECURE_NO_WARNINGS +#endif // --------------------------------------------------------------------------- // Includes --------------------------------------------------------------------- To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org