mirror of
https://github.com/AdaCore/xmlada.git
synced 2026-02-12 12:30:28 -08:00
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/importfromcvs/trunk@11815 936e1b1b-40f2-da11-902a-00137254ae57
235 lines
8.2 KiB
Plaintext
235 lines
8.2 KiB
Plaintext
|
|
XML/Ada: A XML parser for Ada95
|
|
|
|
I - INSTALLING THIS LIBRARY ON UNIX
|
|
II - INSTALLING THIS LIBRARY ON VMS
|
|
III - INSTALLING THIS LIBRARY ON WINDOWS
|
|
IV - TWEAKING THE LIBRARY
|
|
V - USING THE LIBRARY
|
|
VI - TESTING THE LIBRARY
|
|
VII - CONTENTS OF THE LIBRARY
|
|
VIII - LICENSING
|
|
IX - BUG REPORTS
|
|
|
|
|
|
I - INSTALLING THIS LIBRARY ON UNIX
|
|
===================================
|
|
|
|
Make sure that you do not have a previous installation of XML/Ada in one
|
|
of the directories given in ADA_OBJECTS_PATH, or some files will not be
|
|
properly recompiled.
|
|
|
|
Compiling with GNAT 3.14p and GNAT 3.15p
|
|
----------------------------------------
|
|
|
|
Compilation with these older versions of GNAT is done differently than
|
|
with more versions, since the GNAT project files were lacking some important
|
|
features at that point.
|
|
|
|
To compile with such versions, do the following:
|
|
> ./configure --prefix=<PREFIX>
|
|
> <possible Makefile.module.314 modification, as documented below>
|
|
> make -f Makefile.314 install
|
|
|
|
This will compile and install XML/Ada in the <PREFIX> directory. The resulting
|
|
installation can only be used through xmlada-config, as documented below,
|
|
and not with project files.
|
|
|
|
If your system requires -fPIC when compiling source files for shared
|
|
libraries, modify the Makefile.module.314 file to change
|
|
FPIC=
|
|
to
|
|
FPIC=-fPIC
|
|
|
|
Compiling with GNAT 3.16a or newer versions of GNAT
|
|
---------------------------------------------------
|
|
|
|
You might need to modify the following lines in the Makefile.in:
|
|
GNATMAKE= gnatmake
|
|
CC= gcc
|
|
if you are using a compiler other than native GNAT. For instance, if
|
|
you are using a cross-compiler for powerpc/vxworks, you would set them
|
|
to
|
|
GNATMAKE= powerpc-wrs-vxworks-gnatmake
|
|
CC= powerpc-wrs-vxworks-gcc
|
|
|
|
You can also chose the type of library you want to build. The default is
|
|
to build relocatable libraries, although you can chose to build static
|
|
libraries as well. This is done by changing the value of
|
|
LIBRARY_TYPE=relocatable
|
|
in the Makefile.in.
|
|
|
|
Note that if you wish to build both types of libraries, you should first build
|
|
and install the static libraries, then clean the build directory with
|
|
"make clean", and then build and install the shared libraries. The installation
|
|
directories should be different, since the generated code might not be the
|
|
same in both cases, and the second set of project files (see below) would
|
|
overwrite the ones previously installed.
|
|
|
|
Configure and compile with the following commands:
|
|
> ./configure --prefix=<PREFIX>
|
|
> make install
|
|
to build and install the library.
|
|
|
|
Compiling with other Ada compilers
|
|
----------------------------------
|
|
|
|
This library has been reported as being compilable with other compilers than
|
|
GNAT. No build script is provided however, but take a look at
|
|
Makefile.314 and Makefile.module.314 to get ideas on how this could be done.
|
|
|
|
II - INSTALLING THIS LIBRARY ON VMS
|
|
===================================
|
|
|
|
On VMS, you should have a recent version of GNAT (3.15 or more recent), since
|
|
the makefile is set up to use the GNAT project files that are now available.
|
|
|
|
Do the following, from the root directory of XML/Ada:
|
|
|
|
- Edit makefile.vms, and change the PREFIX variable to reflect the directory
|
|
where you want to install XML/Ada
|
|
- make -f makefile.vms
|
|
- make -f makefile.vms install
|
|
If you do not have MKDIR.EXE and other unix-like tools, this command
|
|
will fail.
|
|
You can replace it with some manual steps:
|
|
* Create the installation directory
|
|
* copy the files
|
|
unicode/obj/*
|
|
unicode/*.adb unicode/*.ads
|
|
input_sources/obj/*
|
|
input_sources/*.ads input_sources/*.adb
|
|
sax/obj/*
|
|
sax/*.adb sax/*.ads
|
|
dom/obj/*
|
|
dom/*.adb dom/*.ads
|
|
into this directory
|
|
|
|
To use XML/Ada in your own applications, you need to add the installation
|
|
directory on the gnatmake command line with a -I switch
|
|
|
|
- (optional) make -f makefile.vms test
|
|
This last step is only required if you want to build the test executables
|
|
testsax and testdom which can be used to test the library on any XML file.
|
|
|
|
|
|
III - INSTALLING THIS LIBRARY ON WINDOWS
|
|
========================================
|
|
|
|
1. Due to the nature of GNU Make you need to have a UNIX-type shell and
|
|
utilities installed to build this library. If you do not have this,
|
|
you can download a set at:
|
|
|
|
Cygwin : http://cygwin.com/
|
|
Mingw : http://www.mingw.org/ (MSYS Toolset)
|
|
|
|
2. Run 'configure --prefix=<installation directory>' to generate the makefile.
|
|
where "installation directory" is the place where you want to install
|
|
XML/Ada.
|
|
|
|
3. Before building make sure to set the following values in 'Makefile':
|
|
PREFIX=C:/GNAT/XMLada
|
|
the makefile where to install the library. Note the slashes in the path!
|
|
The value should have been set properly by the call to configure
|
|
|
|
4. The best way to proceed is to do a 'make install'.
|
|
|
|
|
|
IV - TWEAKING THE LIBRARY
|
|
=========================
|
|
|
|
You can change the way the library behaves, in particular the DOM part,
|
|
by changing some of the hard-coded constants in the code. If you change
|
|
these, you will need to recompile the library and your application:
|
|
|
|
- sax-encodings.ads :: Encoding
|
|
It contains the encoding used internally by the library. The default is
|
|
UTF8, which supports the whole Unicode range, and is economical
|
|
memory-wise
|
|
|
|
- dom-core.ads :: Shared_Strings and dom-core.ads :: Shared_Node_Names
|
|
Whether the internal representation of namespaces should be shared among
|
|
nodes. The default is yes
|
|
|
|
V - USING THE LIBRARY
|
|
=====================
|
|
|
|
See the XML/Ada user's guide for information on how to use this library.
|
|
|
|
VI - TESTING THE LIBRARY
|
|
========================
|
|
|
|
Several test programs are provided in the XML/Ada source package. These
|
|
are found in the dom/test and sax/test subdirectories. These are very simple
|
|
examples on how to use the DOM and SAX API.
|
|
|
|
The w3c organization has constructed an official testsuite that can be used to
|
|
check XML/Ada. Most likely, this is only useful to you if you are modifying
|
|
XML/Ada itself. Here is how you can run this testsuite:
|
|
You need to download the official OASIS test suite for XML,
|
|
from www.xml.org. The name of the current archive is
|
|
xmlconf-19990712.tar.Z.
|
|
|
|
Uncompress it somewhere on your disk, then edit the file dom/test/testsuite to
|
|
reflect the location of that testsuite (BASE should point to the directory
|
|
containing these official tests)
|
|
|
|
Execute the file
|
|
make test
|
|
cd dom/test
|
|
./testsuite
|
|
|
|
This will report the number of errors found.
|
|
|
|
|
|
VII - CONTENTS OF THE LIBRARY
|
|
=============================
|
|
|
|
The sources in this library are split into several subdirectories, each
|
|
with its own README, sources, documentation and unit tests.
|
|
|
|
The list of subdirectories (aka modules) is:
|
|
|
|
- unicode:
|
|
provides a full support for Unicode and Utf8/Utf16/Utf32 encodings. It also
|
|
support other encodings like Latin1, Latin2, ...
|
|
|
|
- input_sources
|
|
provides types to read characters from several types of media.
|
|
|
|
- sax
|
|
Provides a common, standard interface for any XML parser, through
|
|
callback subprograms. You can extend any of the tagged types defined in these
|
|
package and thus parse XML files without having to store a XML tree in
|
|
memory.
|
|
This package is compatible with SAX 2.0, but doesn't implement the functions
|
|
specific to SAX 1.0
|
|
|
|
- dom
|
|
The Document Object Model is a set of standard subprograms to manipulate
|
|
XML tree in memory.
|
|
Only the Core module is currently implemented.
|
|
|
|
- docs
|
|
This contains the full documentation for this XML library
|
|
|
|
|
|
VIII - LICENSING
|
|
================
|
|
|
|
This library is distributed under the GNAT-Modified GNU Public License.
|
|
It has the following addition to the GPL:
|
|
|
|
"As a special exception, if other files instantiate generics from
|
|
this unit, or you link this unit with other files to produce an
|
|
executable, this unit does not by itself cause the resulting
|
|
executable to be covered by the GNU General Public License. This
|
|
exception does not however invalidate any other reasons why the
|
|
executable file might be covered by the GNU Public License."
|
|
|
|
IX - BUG REPORTS
|
|
================
|
|
|
|
Please send questions and bug reports to report@gnat.com following
|
|
the same procedures used to submit reports with the GNAT toolset itself.
|