1b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 235e432dd3af2c56c00fc64ca340d1e615030f0a3Elliott Hughes Expat, Release 2.1.0 3b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 4b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectThis is Expat, a C library for parsing XML, written by James Clark. 5b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectExpat is a stream-oriented XML parser. This means that you register 6b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projecthandlers with the parser before starting the parse. These handlers 7b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectare called when the parser discovers the associated structures in the 8b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectdocument being parsed. A start tag is an example of the kind of 9b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectstructures for which you may register handlers. 10b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 11b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectWindows users should use the expat_win32bin package, which includes 12b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectboth precompiled libraries and executables, and source code for 13b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectdevelopers. 14b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 15b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectExpat is free software. You may copy, distribute, and modify it under 16b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectthe terms of the License contained in the file COPYING distributed 17b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectwith this package. This license is the same as the MIT/X Consortium 18b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectlicense. 19b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 20b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectVersions of Expat that have an odd minor version (the middle number in 21b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectthe release above), are development releases and should be considered 22b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectas beta software. Releases with even minor version numbers are 23b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectintended to be production grade software. 24b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 25b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectIf you are building Expat from a check-out from the CVS repository, 26b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectyou need to run a script that generates the configure script using the 27b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectGNU autoconf and libtool tools. To do this, you need to have 2835e432dd3af2c56c00fc64ca340d1e615030f0a3Elliott Hughesautoconf 2.58 or newer. Run the script like this: 29b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 30b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project ./buildconf.sh 31b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 32b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectOnce this has been done, follow the same instructions as for building 33b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectfrom a source distribution. 34b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 35b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectTo build Expat from a source distribution, you first run the 36b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectconfiguration shell script in the top level distribution directory: 37b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 38b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project ./configure 39b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 40b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectThere are many options which you may provide to configure (which you 41b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectcan discover by running configure with the --help option). But the 42b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectone of most interest is the one that sets the installation directory. 43b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectBy default, the configure script will set things up to install 44b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectlibexpat into /usr/local/lib, expat.h into /usr/local/include, and 45b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectxmlwf into /usr/local/bin. If, for example, you'd prefer to install 46b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectinto /home/me/mystuff/lib, /home/me/mystuff/include, and 47b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project/home/me/mystuff/bin, you can tell configure about that with: 48b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 49b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project ./configure --prefix=/home/me/mystuff 50b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 51b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectAnother interesting option is to enable 64-bit integer support for 52b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectline and column numbers and the over-all byte index: 53b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 54b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project ./configure CPPFLAGS=-DXML_LARGE_SIZE 55d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughes 56d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott HughesHowever, such a modification would be a breaking change to the ABI 57d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughesand is therefore not recommended for general use - e.g. as part of 58d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughesa Linux distribution - but rather for builds with special requirements. 59b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 60b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectAfter running the configure script, the "make" command will build 61b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectthings and "make install" will install things into their proper 62b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectlocation. Have a look at the "Makefile" to learn about additional 63b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project"make" options. Note that you need to have write permission into 64b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectthe directories into which things will be installed. 65b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 66b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectIf you are interested in building Expat to provide document 6735e432dd3af2c56c00fc64ca340d1e615030f0a3Elliott Hughesinformation in UTF-16 encoding rather than the default UTF-8, follow 6835e432dd3af2c56c00fc64ca340d1e615030f0a3Elliott Hughesthese instructions (after having run "make distclean"): 69b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 70b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 1. For UTF-16 output as unsigned short (and version/error 71b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project strings as char), run: 72b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 73b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project ./configure CPPFLAGS=-DXML_UNICODE 74b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 75b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project For UTF-16 output as wchar_t (incl. version/error strings), 76b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project run: 77b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 78b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project ./configure CFLAGS="-g -O2 -fshort-wchar" \ 79b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project CPPFLAGS=-DXML_UNICODE_WCHAR_T 80b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 81b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 2. Edit the MakeFile, changing: 82b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 83b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project LIBRARY = libexpat.la 84b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 85b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project to: 86b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 87b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project LIBRARY = libexpatw.la 88b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 89b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project (Note the additional "w" in the library name.) 90b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 91b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 3. Run "make buildlib" (which builds the library only). 92d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughes Or, to save step 2, run "make buildlib LIBRARY=libexpatw.la". 93b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 94b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 4. Run "make installlib" (which installs the library only). 95d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughes Or, if step 2 was omitted, run "make installlib LIBRARY=libexpatw.la". 96d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughes 97d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott HughesUsing DESTDIR or INSTALL_ROOT is enabled, with INSTALL_ROOT being the default 98d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughesvalue for DESTDIR, and the rest of the make file using only DESTDIR. 99d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott HughesIt works as follows: 100d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughes $ make install DESTDIR=/path/to/image 101d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughesoverrides the in-makefile set DESTDIR, while both 102d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughes $ INSTALL_ROOT=/path/to/image make install 103d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughes $ make install INSTALL_ROOT=/path/to/image 104d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughesuse DESTDIR=$(INSTALL_ROOT), even if DESTDIR eventually is defined in the 105d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughesenvironment, because variable-setting priority is 106d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughes1) commandline 107d07d5a72938fd52415368c2320fc29575ae9a0c3Elliott Hughes2) in-makefile 10835e432dd3af2c56c00fc64ca340d1e615030f0a3Elliott Hughes3) environment 10935e432dd3af2c56c00fc64ca340d1e615030f0a3Elliott Hughes 11035e432dd3af2c56c00fc64ca340d1e615030f0a3Elliott HughesNote: This only applies to the Expat library itself, building UTF-16 versions 11135e432dd3af2c56c00fc64ca340d1e615030f0a3Elliott Hughesof xmlwf and the tests is currently not supported. 112b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 113b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectNote for Solaris users: The "ar" command is usually located in 114b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project"/usr/ccs/bin", which is not in the default PATH. You will need to 115b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectadd this to your path for the "make" command, and probably also switch 116b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectto GNU make (the "make" found in /usr/ccs/bin does not seem to work 117b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectproperly -- appearantly it does not understand .PHONY directives). If 118b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectyou're using ksh or bash, use this command to build: 119b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 120b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project PATH=/usr/ccs/bin:$PATH make 121b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 122b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectWhen using Expat with a project using autoconf for configuration, you 123b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectcan use the probing macro in conftools/expat.m4 to determine how to 124b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectinclude Expat. See the comments at the top of that file for more 125b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectinformation. 126b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 127b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectA reference manual is available in the file doc/reference.html in this 128b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectdistribution. 129b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 130b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectThe homepage for this project is http://www.libexpat.org/. There 131b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectare links there to connect you to the bug reports page. If you need 132b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectto report a bug when you don't have access to a browser, you may also 133b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectsend a bug report by email to expat-bugs@mail.libexpat.org. 134b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 135b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source ProjectDiscussion related to the direction of future expat development takes 136b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectplace on expat-discuss@mail.libexpat.org. Archives of this list and 137b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Projectother Expat-related lists may be found at: 138b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project 139b80e287d54a028e744f9fe412840a89ec7f8084bThe Android Open Source Project http://mail.libexpat.org/mailman/listinfo/ 140