1104349Sphk 2302385Sdelphij Expat, Release 2.2.0 3104349Sphk 4104349SphkThis is Expat, a C library for parsing XML, written by James Clark. 5104349SphkExpat is a stream-oriented XML parser. This means that you register 6104349Sphkhandlers with the parser before starting the parse. These handlers 7104349Sphkare called when the parser discovers the associated structures in the 8104349Sphkdocument being parsed. A start tag is an example of the kind of 9104349Sphkstructures for which you may register handlers. 10104349Sphk 11104349SphkWindows users should use the expat_win32bin package, which includes 12178848Scokaneboth precompiled libraries and executables, and source code for 13104349Sphkdevelopers. 14104349Sphk 15104349SphkExpat is free software. You may copy, distribute, and modify it under 16104349Sphkthe terms of the License contained in the file COPYING distributed 17104349Sphkwith this package. This license is the same as the MIT/X Consortium 18104349Sphklicense. 19104349Sphk 20104349SphkVersions of Expat that have an odd minor version (the middle number in 21104349Sphkthe release above), are development releases and should be considered 22104349Sphkas beta software. Releases with even minor version numbers are 23104349Sphkintended to be production grade software. 24104349Sphk 25104349SphkIf you are building Expat from a check-out from the CVS repository, 26104349Sphkyou need to run a script that generates the configure script using the 27104349SphkGNU autoconf and libtool tools. To do this, you need to have 28247296Sdelphijautoconf 2.58 or newer. Run the script like this: 29104349Sphk 30104349Sphk ./buildconf.sh 31104349Sphk 32104349SphkOnce this has been done, follow the same instructions as for building 33104349Sphkfrom a source distribution. 34104349Sphk 35104349SphkTo build Expat from a source distribution, you first run the 36104349Sphkconfiguration shell script in the top level distribution directory: 37104349Sphk 38104349Sphk ./configure 39104349Sphk 40104349SphkThere are many options which you may provide to configure (which you 41104349Sphkcan discover by running configure with the --help option). But the 42104349Sphkone of most interest is the one that sets the installation directory. 43104349SphkBy default, the configure script will set things up to install 44104349Sphklibexpat into /usr/local/lib, expat.h into /usr/local/include, and 45104349Sphkxmlwf into /usr/local/bin. If, for example, you'd prefer to install 46104349Sphkinto /home/me/mystuff/lib, /home/me/mystuff/include, and 47104349Sphk/home/me/mystuff/bin, you can tell configure about that with: 48104349Sphk 49104349Sphk ./configure --prefix=/home/me/mystuff 50178848Scokane 51178848ScokaneAnother interesting option is to enable 64-bit integer support for 52178848Scokaneline and column numbers and the over-all byte index: 53104349Sphk 54178848Scokane ./configure CPPFLAGS=-DXML_LARGE_SIZE 55178848Scokane 56178848ScokaneHowever, such a modification would be a breaking change to the ABI 57178848Scokaneand is therefore not recommended for general use - e.g. as part of 58178848Scokanea Linux distribution - but rather for builds with special requirements. 59178848Scokane 60104349SphkAfter running the configure script, the "make" command will build 61104349Sphkthings and "make install" will install things into their proper 62178848Scokanelocation. Have a look at the "Makefile" to learn about additional 63178848Scokane"make" options. Note that you need to have write permission into 64178848Scokanethe directories into which things will be installed. 65104349Sphk 66104349SphkIf you are interested in building Expat to provide document 67247296Sdelphijinformation in UTF-16 encoding rather than the default UTF-8, follow 68247296Sdelphijthese instructions (after having run "make distclean"): 69104349Sphk 70104349Sphk 1. For UTF-16 output as unsigned short (and version/error 71104349Sphk strings as char), run: 72104349Sphk 73104349Sphk ./configure CPPFLAGS=-DXML_UNICODE 74104349Sphk 75104349Sphk For UTF-16 output as wchar_t (incl. version/error strings), 76104349Sphk run: 77104349Sphk 78104349Sphk ./configure CFLAGS="-g -O2 -fshort-wchar" \ 79104349Sphk CPPFLAGS=-DXML_UNICODE_WCHAR_T 80104349Sphk 81104349Sphk 2. Edit the MakeFile, changing: 82104349Sphk 83104349Sphk LIBRARY = libexpat.la 84104349Sphk 85104349Sphk to: 86104349Sphk 87104349Sphk LIBRARY = libexpatw.la 88104349Sphk 89104349Sphk (Note the additional "w" in the library name.) 90104349Sphk 91104349Sphk 3. Run "make buildlib" (which builds the library only). 92178848Scokane Or, to save step 2, run "make buildlib LIBRARY=libexpatw.la". 93104349Sphk 94104349Sphk 4. Run "make installlib" (which installs the library only). 95178848Scokane Or, if step 2 was omitted, run "make installlib LIBRARY=libexpatw.la". 96178848Scokane 97178848ScokaneUsing DESTDIR or INSTALL_ROOT is enabled, with INSTALL_ROOT being the default 98178848Scokanevalue for DESTDIR, and the rest of the make file using only DESTDIR. 99178848ScokaneIt works as follows: 100178848Scokane $ make install DESTDIR=/path/to/image 101178848Scokaneoverrides the in-makefile set DESTDIR, while both 102178848Scokane $ INSTALL_ROOT=/path/to/image make install 103178848Scokane $ make install INSTALL_ROOT=/path/to/image 104178848Scokaneuse DESTDIR=$(INSTALL_ROOT), even if DESTDIR eventually is defined in the 105178848Scokaneenvironment, because variable-setting priority is 106178848Scokane1) commandline 107178848Scokane2) in-makefile 108247296Sdelphij3) environment 109104349Sphk 110247296SdelphijNote: This only applies to the Expat library itself, building UTF-16 versions 111247296Sdelphijof xmlwf and the tests is currently not supported. 112247296Sdelphij 113104349SphkNote for Solaris users: The "ar" command is usually located in 114104349Sphk"/usr/ccs/bin", which is not in the default PATH. You will need to 115104349Sphkadd this to your path for the "make" command, and probably also switch 116104349Sphkto GNU make (the "make" found in /usr/ccs/bin does not seem to work 117302385Sdelphijproperly -- apparently it does not understand .PHONY directives). If 118104349Sphkyou're using ksh or bash, use this command to build: 119104349Sphk 120104349Sphk PATH=/usr/ccs/bin:$PATH make 121104349Sphk 122104349SphkWhen using Expat with a project using autoconf for configuration, you 123104349Sphkcan use the probing macro in conftools/expat.m4 to determine how to 124104349Sphkinclude Expat. See the comments at the top of that file for more 125104349Sphkinformation. 126104349Sphk 127104349SphkA reference manual is available in the file doc/reference.html in this 128104349Sphkdistribution. 129104349Sphk 130104349SphkThe homepage for this project is http://www.libexpat.org/. There 131104349Sphkare links there to connect you to the bug reports page. If you need 132104349Sphkto report a bug when you don't have access to a browser, you may also 133104349Sphksend a bug report by email to expat-bugs@mail.libexpat.org. 134104349Sphk 135104349SphkDiscussion related to the direction of future expat development takes 136104349Sphkplace on expat-discuss@mail.libexpat.org. Archives of this list and 137104349Sphkother Expat-related lists may be found at: 138104349Sphk 139178848Scokane http://mail.libexpat.org/mailman/listinfo/ 140