FAQ: Distribution

Distributing XML4C

Is XML4C completely free? What shared libraries are needed to distribute XML4C? Are there any terms and conditions of usage? Look below to know the answers.

  1. Which DLL's do I need to distribute with my application?
  2. How do I package the sources to create a binary drop?
  3. How do I build binaries from the XML4C source code?
  4. When will a port to my platform be available?
  5. How can I port XML4C to my favorite platform?
  6. I'm interested to know what application you used to create the documentation?
  7. Can I get the source code for the C++ Builder TreeViewer application whose screen shot appears on the front page of XML4C documentation?
  8. Can I use XML4C in my product?

The Answers ...

Which DLL's do I need to distribute with my application?

The current XML4C2 distribution contains only one shared library, IXXML4C2_2.DLL. To distribute your application, you will need to distribute just this DLL along with your own. On AIX the shared library name is libIXXML4C2_2.a , on Solaris/Linux it is called libIXXML4C2_2.so while on HP-UX it is called libIXXML4C2_2.sl

 

How do I package the sources to create a binary drop?

The description under holds only for Windows platforms.

You have to first compile the sources inside your IDE to create the required DLLs and EXEs. Then you need to copy over the binaries to another directory for the binary drop. A batch file has been provided to give you a jump start. The file may not work if you have changed your source tree. You have to modify the batch file to suit your current state of the source tree. To invoke the batch file, go to the \xml4c2\scripts\Win32 directory, and type:

     MakeRel

You will get a message that looks like:

Usage: MakeRel target srcbins srcsrcs
     
     This file will create a binary release from a source release. It needs to know the following things:
     
     1)  The target directory for the binary release tree
     2)  The source directory to get the headers and samples from
     3)  The source directory where the binary files are
     
     These are passed as parameters 1, 2, and 3
     So, if the build tree is \XML4C2, the build is Visual C++ 6.0, and the target is \BinBuild\ you would do this:
     
         MakeRel \BinBuild \XML4C2\Build\Win32\VC6\Release \XML4C2
     
     DO NOT END ANY parameters with a slash
     
     This script is provided to you as an aid to creating workable binary releases. This may or may not work depending on how you have changed your source code. IBM does not offer any support for using this batch file. This is provided to give you a jump start for creating your own batch scripts.

As explained above, if your build tree is \XML4C2, the build is Visual C++ 6.0, and the target is \BinBuild\ you should type the following to get a binary tree for packaging:

MakeRel \BinBuild \XML4C2\Build\Win32\VC6\Release \XML4C2

 

How do I build binaries from the XML4C source code?

On Windows NT/95/98:

We have provided you some simple scripts to create a binary drop from compiled sources. First you need to build the sources. On Windows platforms, your can build the entire source from inside the MSVC IDE by invoking the workspace,

\xml4csrc2_2_0\Projects\Win32\VC6\IXXML4C2\IXXML4C2. dsw

To convert the compiled sources to a binary drop that you can ship, we have supplied you with some simple scripts. These scripts are given only for your convenience and you may need to modify it to suit your need.

MakeRel targetdirectory sourcebinaries sourcedirectory

On UINX (AIX, Solaris, HP-UX, Linux):

Note: We are working on improving the build environment by using utilities like 'autoconf'.

First make sure that you have the following two environment variables set:

export ROOTDIR=$HOME/xml4csrc2_2_0
export LIBPATH=$ROOTDIR/lib:$LIBPATH (on AIX)
OR export LD_LIBRARY_PATH=$ROOTDIR/lib:$LD_LIBRARY_PATH (on Solaris)
export SHLIB_PATH=$ROOTDIR/lib:$SHLIB_PATH (on HP-UX)

Now run the script scripts/<platform>/buildRel to build the sources. For example:

buildRel $HOME/xml4csrc2_2_0

To build a debug version, use:

buildDebug $HOME/xml4csrc2_2_0

Finally, to package into a binary, type

MakeRel targetname sourcedirectory

For example, MakeRel xml4csrc2_2_0 /home/xml4c/xml4c2

Note: Make sure you also read how to build your application using the source code.

 

When will a port to my platform be available?

Ports to other platforms are planned, but dates are not fixed yet. In the meantime, look below to see a description of the steps you need to follow to port it to another platform.

We strongly encourage you to submit the changes that were required to make it work on another platform. We will incorporate these changes in the source code base and make them available in the future releases.

All such changes may be sent to xml4c@us.ibm.com.

 

How can I port XML4C to my favourite platform?

All platform dependent code in XML4C2 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 XML4C2.

1. The directory ' src/com/ibm/xml/util' contains the platform and development environment sensitive files. Each operating system has a file of its own and each development environment has another one of its own. (if that development environment covers multiple platforms you could use one internally ifdef'd one or have multiple ones with different names, your call).

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.

2. 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.

3. Now edit 'AutoSense.Hpp'. Here we set canonical XML4C 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.

4 . 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.

5. 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.

Be aware that currently, the XXXPlatformUtils.cpp files are directly in the 'util' subdirectory. For the next release, we will probably move them to a per-platform subdirectory. This will keep the code more cleanly separated and make it obvious what files are platform-dependent and which are platform-independent.

 

I'm interested to know what application you used to create the documentation?

Documentation in XML4C was created using NetObjects Fusion software.

The API documentation was created using DOC++ which is available from

http://www.zib.de/Visual/software/doc++/index.html

 

Can I get the source code for the C++ Builder TreeViewer application whose screen shot appears on the front page of XML4C documentation?

In view of the numerous requests that we have received for the TreeViewer sample application (written using C++ Builder), we have decided to make it available as an independent download from IBM's AlphaWorks portal. Please note, this is provided on a "as-is, no support" basis.

This demo application parses the XML file, using XML4C, IBM's XML parser for C++, and displays the data as a tree.

The URL is: http://www.alphaWorks.ibm.com

We welcome your additional feedback at: xml4c@us.ibm.com

 

Can I use XML4C in my product?

Yes! Read the license agreement first and contact us at xml4c@us.ibm.com if you need assistance.

 

Copyright (c) IBM Corp. 1999, Center for Java Technology, Cupertino, USA