|
 |  |  |  | Which DLL's do I need to distribute with my application? |  |  |  |  |
| |
There are currently two configurations in which Xerces-C binaries
are published. One is from the Apache site, while the other is
from the IBM Alphaworks Site.
The Apache download
site binary drops only contain support for ASCII, UTF-8, UTF-16
and UCS4 encodings. The parser intrinsically supports transcoding
input files in these encodings to Unicode (all internal processing in
the parser happens in Unicode). If you are using these Xerces-C
binaries in your application, then you only need to distribute
one file:
xerces-c_1_0.dll for Windows NT/95/98, or
libxerces-c1_0.a for AIX, or
libxerces-c1_0.so for Solaris/Linux, or
libxerces-c1_0.sl for HP-UX.
However, if your application needs to support more international
encodings, other than the one's mentioned above, then you may use the
XML4C binaries published by IBM at their AlphaWorks
site. XML4C binaries use and include IBM
Classes for Unicode (ICU) (also an open source project but
under IBM
Public License) for transcoding and as a result can parse input
files in over 100 different encodings. If you are using XML4C binaries
in your application, then in addition to the Xerces-C library
file mentioned above, you also need to ship:
- ICU shared library file:
icuuc.dll for Windows NT/95/98, or
libicu-uc.a for AIX, or
libicu-uc.so for Solaris/Linux, or
libicu-uc.sl for HP-UX.
- ICU converter files: *.cnv.
These are platform specific binary files which contain the tables used
to transcode characters from the respective encoding to Unicode. These
files may be found in the 'lib/icu/data' directory of the XML4C binary
archives.
|
 |  |  |  | How can I port Xerces to my favourite platform? |  |  |  |  |
| |
All platform dependent code in Xerces has been isolated to
a couple of files, which should ease the porting effort.
Here are the basic steps that should be followed to port
Xerces.
- The directory 'src/util/Platforms' contains the
platform sensitive files while 'src/util/Compilers' contains all
development environment sensitive files. Each
operating system has a file of its own and each
development environment has another one of its own too.
As an example, the Win32 platform as a Win32Defs.hpp file
and the Visual C++ environment has a VCPPDefs.hpp file.
These files set up certain define tokens, typedefs,
constants, etc... that will drive the rest of the code to
do the right thing for that platform and development
environment. AIX/CSet have their own AIXDefs.hpp and
CSetDefs.hpp files, and so on. You should create new
versions of these files for your platform and environment
and follow the comments in them to set up your own.
Probably the comments in the Win32 and Visual C++ will be
the best to follow, since that is where the main
development is done.
- Next, edit the file XML4CDefs.hpp , which is where all
of the fundamental stuff comes into the system. You will
see conditional sections in there where the above
per-platform and per-environment headers are brought in.
Add the new ones for your platform under the appropriate
conditionals.
- Now edit 'AutoSense.hpp'. Here we set canonical Xerces
internal #define tokens which indicate the platform and
compiler. These definitions are based on known platform
and compiler defines.
AutoSense.hpp is included in XML4CDefs.hpp and the
canonical platform and compiler settings thus defined will
make the particular platform and compiler headers to be
the included at compilation.
It might be a little tricky to decipher this file so be
careful. If you are using say another compiler on Win32,
probably it will use similar tokens so that the platform
will get picked up already using what is already there.
- Once this is done, you will then need to implement a
version of the 'platform utilities' for your platform.
Each operating system has a file which implements some
methods of the XMLPlatformUtils class, specific to that
operating system. These are not terribly complex, so it
should not be a lot of work. The Win32 verions is called
Win32PlatformUtils.cpp, the AIX version is
AIXPlatformUtils.cpp and so on. Create one for your
platform, with the correct name, and empty out all of the
implementation so that just the empty shells of the
methods are there (with dummy returns where needed to make
the compiler happy.) Once you've done that, you can start
to get it to build without any real implementation.
- Once you have the system building, then start
implementing your own platform utilties methods. Follow
the comments in the Win32 version as to what they do, the
comments will be improved in subsequent versions, but they
should be fairly obvious now. Once you have these
implementations done, you should be able to start
debugging the system using the demo programs.
That is the work required in a nutshell.
|
|