## Building Xalan-C/C++ The Xalan-C/C++ XSLT library is built upon the Xerces-C/C++ XML Parser library. Before compiling the Xalan-C/C++ XSLT library, you must have a usable Xerces-C/C++ library.
Incompatibilities between C++ compilers (even between compiler versions) are known to cause issues with sharing of libraries. We don't have persons yet committed to build binary distribution releases for the Xalan-C/C++ XSLT library. You can get information on the Xerces-C/C++ XML parser distributions at web site [http://xml.apache.org/xerces-c/]. ## Windows Build Environment Build support for Microsoft Visual Studio (VC6) is deprecated. Building Xalan-C/C++ with Microsoft Visual Studio (VC6) requires the Xerces-C/C++ version 2.8 or earlier releases. Microsoft VC6 is removed from the Xerces-C/C++ Version 3.x releases. Building Xalan-C/C++ with Microsoft Visual Studio .NET 2008 (VC9) requires Xerces-C/C++ version 3.1 or newer. Building with Microsoft Visual Studio .NET 2010 (VC10) requires Xerces-C/C++ version 3.1.1 or newer. The Microsoft Visual Studio .NET 2010 (VC10) build is not fully integrated into the source tree. You will need to copy the {SourceDir}/Projects/Win32/VC9 directory to a (VC10) directory and allow Microsoft to attempt an automatic upgrade. A (VC10) directory will become part of the source tree after the product passes quality control inspection. Environment variables XERCESCROOT and XALANCROOT are required. Environment ICUROOT is used only if building Xalan-C/C++ with IBM-ICU library support. XERCESCROOT = The Xerces-C/C++ installation directory XALANCROOT = The Xalan-C/C++ source directory ICUROOT = The IBM-ICU installation directory (only if building with ICU support) I like to create command or batch files to setup the build environment variables and start the Visual Studio .NET development system using the custom build environment. I find this much easier than navigating the graphical interface to add custom build environments. The Microsoft *.vsconf files for custom configurations are not available in the early versions Visual Studio .NET platforms. ## Sample Windows Build Command File I like to use this template for both Xerces-C and Xalan-C builds from sources. The sample shown here is for Xalan-C/C++ because the installation of Xerces-C/C++ should already have been done. --- SET XERCESCROOT="path to xerces-c installation" SET XALANCROOT="sources\xalan\c\" --- Set the xalan project path for your version of Visual Studio .NET. --- :: VS 2003 (VC7.1) SET XALANCPROJDIR=%XALANCROOT%\Projects\Win32\VC7.1 :: VS 2005 (VC8) SET XALANCPROJDIR=%XALANCROOT%\Projects\Win32\VC8 :: VS 2008 (VC9) SET XALANCPROJDIR=%XALANCROOT%\Projects\Win32\VC9 :: VS 2010 (VC10) - experimental SET XALANCPROJDIR=%XALANCROOT%\Projects\Win32\VC10 --- Set some environment variables so we can easily copy or install the products after they have been built. --- :: VS 2003 (VC7.1) SET XALANCBUILDDIR=%XALANCROOT%\Build\Win32\VC7.1 :: VS 2005 (VC8) SET XALANCBUILDDIR=%XALANCROOT%\Build\Win32\VC8 :: VS 2008 (VC9) SET XALANCBUILDDIR=%XALANCROOT%\Build\Win32\VC9 :: VS 2010 (VC10) - experimental SET XALANCBUILDDIR=%XALANCROOT%\Build\Win32\VC10 --- We use this XALANCBUILDSLN Visual Studio .NET solution file. --- SET XALANCBUILDSLN=%XALANCPROJDIR\xalan.sln --- The $(variable) is expanded inside Visual Studio. The %variable% is expanded by the cmd utility before launching the Visual Studio. --- SET PATH=%WINDIR%\system32;%WINDIR%;%WINDIR%\system32\Wbem SET INCLUDE= SET LIB= SET LIBPATH= SET SOURCE= --- Set the default environment variables for your version of Microsoft Visual Studio .NET. --- :: VS 2000 (VC7) - obsolete call "%VS70COMNTOOLS%vsvars32.bat" :: VS 2003 (VC7.1) call "%VS71COMNTOOLS%vsvars32.bat" :: VS 2005 (VC8) call "%VS80COMNTOOLS%vsvars32.bat" :: VS 2008 (VC9) call "%VS90COMNTOOLS%vsvars32.bat" :: VS 2010 (VC10) - experimental call "%VS100COMNTOOLS%vsvars32.bat" --- The LIBPATH and SOURCE environment variables may not be properly set by the vsvars32.bat command file. You may wish to start your Visual Studio .NET application and examine the C/C++ project defaults for search libraries. Then specifically set the paths in your build command file. The Xalan-C and Xerces-C libraries do not use the Microsoft Framework and the "atl" directives. --- :: VS 2003 (VC7.1) :: SET LIBPATH=$(FrameWorkDir)$(FrameWorkVersion) :: SET SOURCE=$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\atl; :: SET SOURCE=%SOURCE%;$(VCInstallDir)crt\src :: VS 2005 (VC8) :: SET LIBPATH=%(FrameworkDir)$(FrameWorkVersion) :: SET SOURCE=$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\atl; :: SET SOURCE=%SOURCE%;$(VCInstallDir)crt\src :: VS 2008 (VC9) :: SET LIBPATH=%(FrameworkDir)$(FrameWorkVersion) :: SET SOURCE=$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\atl; :: SET SOURCE=%SOURCE%;$(VCInstallDir)crt\src --- Define the necessary environment variables for building the Xalan-C/C++ libraries and sample programs. --- SET PATH=%PATH%;%XERCESCROOT%\bin SET INCLUDE=%INCLUDE%;%XERCESCROOT%\include;%XERCESCROOT%\src SET INCLUDE=%INCLUDE%;%XALANCROOT%\src SET LIB=%LIB%;%XERCESCROOT%\lib If you are going to build for IBM-ICU support, then add the following environments. SET ICUROOT="path to ibm-icu installation" SET PATH=%PATH%;%ICUROOT%\bin SET INCLUDE=%INCLUDE%;%ICUROOT%\include SET LIB=%LIB%;%ICUROOT%\lib;%ICUROOT%\data --- Now we should be ready to start the Microsoft Visual Studio .NET using our custom environment using the %XALANCBUILDSLN% solution. --- devenv.exe "%XALANCBUILDSLN%" /useenv --- ## Installing the Xalan Library on Windows The following command script will install the binary and header files to a target directory that is compatible with the XALANCROOT environment variable for creating applications. Environment variables other than XALANCTARGET are defined in the previous section, the Visual Studio .NET build example. SET XALANCTARGET="path-to-target-directory" MKDIR "%XALANCTARGET%\bin" MKDIR "%XALANCTARGET%\include" MKDIR "%XALANCTARGET%\lib" CD "%XALANCBUILDDIR%\Release\Nls" COPY *.hpp "%XALANCTARGET%"\include CD "%XALANCBUILDDIR%\Release" COPY *.DLL "%XALANCTARGET%\bin" COPY *.LIB "%XALANCTARGET%\lib" COPY *.EXP "%XALANCTARGET%\lib" CD "%XALANCBUILDDIR%\Debug" COPY *.DLL "%XALANCTARGET%\bin" COPY *.PDB "%XALANCTARGET%\bin" COPY *.LIB "%XALANCTARGET%\lib" COPY *.EXP "%XALANCTARGET%\lib" CD "%XALANCROOT%\src XCOPY xalanc\*.hpp "%XALANCTARGET%\include\xalanc" /E /C /I /R /Y XCOPY xalanc\*.h "%XALANCTARGET%\include\xalanc" /E /C /I /R /Y ## Xerces-C/C++ Transcoders and Plug-in Modules Xerces-C/C++ XML Parsers have undergone some additional modularity features. In the version 3 series, the transcoders are no longer integrated into the parsers. There is a basic transcoding library. Other custom transcoding libraries can be registered at application runtime for use. Use of the transcoding modules is still experimental for Xalan-C/C++ transformation applications. A plug-in memory management architecture was introduced in Xerces-C/C++ version 2.7. The plug-in memory management of Xerces-C/C++ is supported by Xalan-C/C++ applications.