import libxml2-2.6.20. I did not bother with a vendor import as I don't care much about tracking changes and more recent versions don't even build on mingw

svn path=/trunk/; revision=19980
This commit is contained in:
Steven Edwards 2005-12-08 22:15:30 +00:00
parent f6c92b0c0e
commit d693a6fb89
3493 changed files with 771777 additions and 0 deletions

View file

@ -0,0 +1,5 @@
Daniel Veillard <daniel@veillard.com>
Bjorn Reese <breese@users.sourceforge.net>
William Brack <wbrack@mmm.com.hk>
Igor Zlatkovic <igor@zlatkovic.com> for the Windows port
Aleksey Sanin <aleksey@aleksey.com>

View file

@ -0,0 +1,27 @@
Except where otherwise noted in the source code (e.g. the files hash.c,
list.c and the trio files, which are covered by a similar licence but
with different Copyright notices) all the files are:
Copyright (C) 1998-2003 Daniel Veillard. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is fur-
nished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Daniel Veillard shall not
be used in advertising or otherwise to promote the sale, use or other deal-
ings in this Software without prior written authorization from him.

15945
reactos/lib/libxml2/ChangeLog Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,27 @@
Except where otherwise noted in the source code (e.g. the files hash.c,
list.c and the trio files, which are covered by a similar licence but
with different Copyright notices) all the files are:
Copyright (C) 1998-2003 Daniel Veillard. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is fur-
nished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Daniel Veillard shall not
be used in advertising or otherwise to promote the sale, use or other deal-
ings in this Software without prior written authorization from him.

View file

@ -0,0 +1,305 @@
/*
* DOCBparser.c : an attempt to parse SGML Docbook documents
*
* This is deprecated !!!
* Code removed with release 2.6.0 it was broken.
* The doc are expect to be migrated to XML DocBook
*
* See Copyright for the status of this software.
*
* daniel@veillard.com
*/
#define IN_LIBXML
#include "libxml.h"
#ifdef LIBXML_DOCB_ENABLED
#include <libxml/xmlerror.h>
#include <libxml/DOCBparser.h>
/**
* docbEncodeEntities:
* @out: a pointer to an array of bytes to store the result
* @outlen: the length of @out
* @in: a pointer to an array of UTF-8 chars
* @inlen: the length of @in
* @quoteChar: the quote character to escape (' or ") or zero.
*
* Take a block of UTF-8 chars in and try to convert it to an ASCII
* plus SGML entities block of chars out.
*
* Returns 0 if success, -2 if the transcoding fails, or -1 otherwise
* The value of @inlen after return is the number of octets consumed
* as the return value is positive, else unpredictable.
* The value of @outlen after return is the number of octets consumed.
*/
int
docbEncodeEntities(unsigned char *out ATTRIBUTE_UNUSED,
int *outlen ATTRIBUTE_UNUSED,
const unsigned char *in ATTRIBUTE_UNUSED,
int *inlen ATTRIBUTE_UNUSED,
int quoteChar ATTRIBUTE_UNUSED)
{
static int deprecated = 0;
if (!deprecated) {
xmlGenericError(xmlGenericErrorContext,
"docbEncodeEntities() deprecated function reached\n");
deprecated = 1;
}
return(-1);
}
/**
* docbParseDocument:
* @ctxt: an SGML parser context
*
* parse an SGML document (and build a tree if using the standard SAX
* interface).
*
* Returns 0, -1 in case of error. the parser context is augmented
* as a result of the parsing.
*/
int
docbParseDocument(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
{
static int deprecated = 0;
if (!deprecated) {
xmlGenericError(xmlGenericErrorContext,
"docbParseDocument() deprecated function reached\n");
deprecated = 1;
}
return (xmlParseDocument(ctxt));
}
/**
* docbFreeParserCtxt:
* @ctxt: an SGML parser context
*
* Free all the memory used by a parser context. However the parsed
* document in ctxt->myDoc is not freed.
*/
void
docbFreeParserCtxt(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
{
static int deprecated = 0;
if (!deprecated) {
xmlGenericError(xmlGenericErrorContext,
"docbFreeParserCtxt() deprecated function reached\n");
deprecated = 1;
}
xmlFreeParserCtxt(ctxt);
}
/**
* docbParseChunk:
* @ctxt: an XML parser context
* @chunk: an char array
* @size: the size in byte of the chunk
* @terminate: last chunk indicator
*
* Parse a Chunk of memory
*
* Returns zero if no error, the xmlParserErrors otherwise.
*/
int
docbParseChunk(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
const char *chunk ATTRIBUTE_UNUSED,
int size ATTRIBUTE_UNUSED,
int terminate ATTRIBUTE_UNUSED)
{
static int deprecated = 0;
if (!deprecated) {
xmlGenericError(xmlGenericErrorContext,
"docbParseChunk() deprecated function reached\n");
deprecated = 1;
}
return (xmlParseChunk(ctxt, chunk, size, terminate));
}
/**
* docbCreatePushParserCtxt:
* @sax: a SAX handler
* @user_data: The user data returned on SAX callbacks
* @chunk: a pointer to an array of chars
* @size: number of chars in the array
* @filename: an optional file name or URI
* @enc: an optional encoding
*
* Create a parser context for using the DocBook SGML parser in push mode
* To allow content encoding detection, @size should be >= 4
* The value of @filename is used for fetching external entities
* and error/warning reports.
*
* Returns the new parser context or NULL
*/
docbParserCtxtPtr
docbCreatePushParserCtxt(docbSAXHandlerPtr sax ATTRIBUTE_UNUSED,
void *user_data ATTRIBUTE_UNUSED,
const char *chunk ATTRIBUTE_UNUSED,
int size ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED,
xmlCharEncoding enc ATTRIBUTE_UNUSED)
{
static int deprecated = 0;
if (!deprecated) {
xmlGenericError(xmlGenericErrorContext,
"docbParseChunk() deprecated function reached\n");
deprecated = 1;
}
return(xmlCreatePushParserCtxt(sax, user_data, chunk, size, filename));
}
/**
* docbSAXParseDoc:
* @cur: a pointer to an array of xmlChar
* @encoding: a free form C string describing the SGML document encoding, or NULL
* @sax: the SAX handler block
* @userData: if using SAX, this pointer will be provided on callbacks.
*
* parse an SGML in-memory document and build a tree.
* It use the given SAX function block to handle the parsing callback.
* If sax is NULL, fallback to the default DOM tree building routines.
*
* Returns the resulting document tree
*/
docbDocPtr
docbSAXParseDoc(xmlChar * cur ATTRIBUTE_UNUSED,
const char *encoding ATTRIBUTE_UNUSED,
docbSAXHandlerPtr sax ATTRIBUTE_UNUSED,
void *userData ATTRIBUTE_UNUSED)
{
static int deprecated = 0;
if (!deprecated) {
xmlGenericError(xmlGenericErrorContext,
"docbParseChunk() deprecated function reached\n");
deprecated = 1;
}
return (xmlSAXParseMemoryWithData(sax, (const char *)cur,
xmlStrlen((const xmlChar *) cur), 0, userData));
}
/**
* docbParseDoc:
* @cur: a pointer to an array of xmlChar
* @encoding: a free form C string describing the SGML document encoding, or NULL
*
* parse an SGML in-memory document and build a tree.
*
* Returns the resulting document tree
*/
docbDocPtr
docbParseDoc(xmlChar * cur ATTRIBUTE_UNUSED,
const char *encoding ATTRIBUTE_UNUSED)
{
static int deprecated = 0;
if (!deprecated) {
xmlGenericError(xmlGenericErrorContext,
"docbParseChunk() deprecated function reached\n");
deprecated = 1;
}
return (xmlParseDoc(cur));
}
/**
* docbCreateFileParserCtxt:
* @filename: the filename
* @encoding: the SGML document encoding, or NULL
*
* Create a parser context for a file content.
* Automatic support for ZLIB/Compress compressed document is provided
* by default if found at compile-time.
*
* Returns the new parser context or NULL
*/
docbParserCtxtPtr
docbCreateFileParserCtxt(const char *filename ATTRIBUTE_UNUSED,
const char *encoding ATTRIBUTE_UNUSED)
{
static int deprecated = 0;
if (!deprecated) {
xmlGenericError(xmlGenericErrorContext,
"docbCreateFileParserCtxt() deprecated function reached\n");
deprecated = 1;
}
return (xmlCreateFileParserCtxt(filename));
}
/**
* docbSAXParseFile:
* @filename: the filename
* @encoding: a free form C string describing the SGML document encoding, or NULL
* @sax: the SAX handler block
* @userData: if using SAX, this pointer will be provided on callbacks.
*
* parse an SGML file and build a tree. Automatic support for ZLIB/Compress
* compressed document is provided by default if found at compile-time.
* It use the given SAX function block to handle the parsing callback.
* If sax is NULL, fallback to the default DOM tree building routines.
*
* Returns the resulting document tree
*/
docbDocPtr
docbSAXParseFile(const char *filename ATTRIBUTE_UNUSED,
const char *encoding ATTRIBUTE_UNUSED,
docbSAXHandlerPtr sax ATTRIBUTE_UNUSED,
void *userData ATTRIBUTE_UNUSED)
{
static int deprecated = 0;
if (!deprecated) {
xmlGenericError(xmlGenericErrorContext,
"docbSAXParseFile() deprecated function reached\n");
deprecated = 1;
}
return (xmlSAXParseFileWithData(sax, filename, 0, userData));
}
/**
* docbParseFile:
* @filename: the filename
* @encoding: a free form C string describing document encoding, or NULL
*
* parse a Docbook SGML file and build a tree. Automatic support for
* ZLIB/Compress compressed document is provided by default if found
* at compile-time.
*
* Returns the resulting document tree
*/
docbDocPtr
docbParseFile(const char *filename ATTRIBUTE_UNUSED,
const char *encoding ATTRIBUTE_UNUSED)
{
static int deprecated = 0;
if (!deprecated) {
xmlGenericError(xmlGenericErrorContext,
"docbParseFile() deprecated function reached\n");
deprecated = 1;
}
return (xmlParseFile(filename));
}
#define bottom_DOCBparser
#include "elfgcchack.h"
#endif /* LIBXML_DOCB_ENABLED */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,69 @@
Extracted from the documentation:
http://xmlsoft.org/FAQ.html#Compilatio
Compilation
1.What is the process to compile libxml ?
As most UNIX libraries libxml follows the "standard":
gunzip -c xxx.tar.gz | tar xvf -
cd libxml-xxxx
./configure --help
to see the options, then the compilation/installation proper
./configure [possible options]
make
make install
At that point you may have to rerun ldconfig or similar utility to
update your list of installed shared libs.
At this point you can check that the library is properly functionning
by running
make tests
2.What other libraries are needed to compile/install libxml ?
Libxml does not requires any other library, the normal C ANSI API
should be sufficient (please report any violation to this rule you
may find).
However if found at configuration time libxml will detect and use
the following libs:
libz: a highly portable and available widely compression library
http://www.info-zip.org/pub/infozip/zlib/
iconv: a powerful character encoding conversion library. It's
included by default on recent glibc libraries, so it doesn't
need to be installed specifically on linux. It seems it's
now part of the official UNIX specification. Here is one
implementation of the library which source can be found here.
http://clisp.cons.org/~haible/packages-libiconv.html
ftp://ftp.ilog.fr/pub/Users/haible/gnu/
3.libxml does not compile with HP-UX's optional ANSI-C compiler
this is due to macro limitations. Try to add " -Wp,-H16800 -Ae"
to the CFLAGS
you can also install and use gcc instead or use a precompiled version
of libxml, both available from the HP-UX Porting and Archive Centre
4.make tests fails on some platforms
Sometime the regression tests results don't completely match the
value produced by the parser, and the makefile uses diff to print
the delta. On some platforms the diff return breaks the compilation
process, if the diff is small this is probably not a serious problem
Daniel
veillard@redhat.com
$Id: INSTALL,v 1.3 2001/06/17 10:32:52 veillard Exp $

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,35 @@
#
# You may have to ajust to call the right compiler, or other oprions
# for compiling and linking
#
CFLAGS=`xml2-config --cflags`
LIBS=`xml2-config --libs`
THREADLIB= -lpthread
EXEEXT=
all: runtest$(EXEEXT) runsuite$(EXEEXT) testapi$(EXEEXT)
clean:
$(RM) runtest$(EXEEXT) runsuite$(EXEEXT) testapi$(EXEEXT)
check: do_runtest do_runsuite do_testapi
runtest$(EXEEXT): runtest.c
$(CC) -o runtest$(EXEEXT) $(CFLAGS) runtest.c $(LIBS) $(THREADLIB)
do_runtest: runtest$(EXEEXT)
./runtest
runsuite$(EXEEXT): runsuite.c
$(CC) -o runsuite$(EXEEXT) $(CFLAGS) runsuite.c $(LIBS)
do_runsuite: runsuite$(EXEEXT)
./runsuite
testapi$(EXEEXT): testapi.c
$(CC) -o testapi$(EXEEXT) $(CFLAGS) testapi.c $(LIBS)
do_testapi: testapi$(EXEEXT)
./testapi

1488
reactos/lib/libxml2/NEWS Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,39 @@
XML toolkit from the GNOME project
Full documentation is available on-line at
http://xmlsoft.org/
This code is released under the MIT Licence see the Copyright file.
To build on an Unixised setup:
./configure ; make ; make install
To build on Windows:
see instructions on win32/Readme.txt
To assert build quality:
on an Unixised setup:
run make tests
otherwise:
There is 3 standalone tools runtest.c runsuite.c testapi.c, which
should compile as part of the build or as any application would.
Launch them from this directory to get results, runtest checks
the proper functionning of libxml2 main APIs while testapi does
a full coverage check. Report failures to the list.
To report bugs, follow the instructions at:
http://xmlsoft.org/bugs.html
A mailing-list xml@gnome.org is available, to subscribe:
http://mail.gnome.org/mailman/listinfo/xml
The list archive is at:
http://mail.gnome.org/archives/xml/
All technical answers asked privately will be automatically answered on
the list and archived for public access unless pricacy is explicitely
required and justified.
Daniel Veillard
$Id: README,v 1.13 2005/07/10 21:38:25 veillard Exp $

View file

@ -0,0 +1,29 @@
README.tests
Instructions for standalone test regressions of libxml2
libxml2-tests-$version.tar.gz contains 3 standalone C programs as well
as a large amount of tests and results coming from libxml2 itself and
from W3C, NIST, Sun Microsystems, Microsoft and James Clark. Each C
program has a different testing purpose:
runtest.c : runs libxml2 basic internal regression tests
runsuite.c: runs libxml2 against external regression tests
testapi.c : exercises the library public entry points
The command:
make -f Makefile.tests
should be sufficient on an Unix system to build and exercise the tests
for the version of the library installed on the system. Note however
that there isn't backward compatibility provided so if the installed
version is older to the testsuite one, failing to compile or run the tests
is likely. In any event this won't work with an installed libxml2 older
than 2.6.20.
Building on other platfroms should be a matter of compiling the C files
like any other program using libxml2, running the test should be done
simply by launching the resulting executables.
Daniel Veillard
Sun Jul 10 2005

180
reactos/lib/libxml2/SAX.c Normal file
View file

@ -0,0 +1,180 @@
/*
* SAX.c : Old SAX v1 handlers to build a tree.
* Deprecated except for compatibility
*
* See Copyright for the status of this software.
*
* Daniel Veillard <daniel@veillard.com>
*/
#define IN_LIBXML
#include "libxml.h"
#include <stdlib.h>
#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/parserInternals.h>
#include <libxml/valid.h>
#include <libxml/entities.h>
#include <libxml/xmlerror.h>
#include <libxml/debugXML.h>
#include <libxml/xmlIO.h>
#include <libxml/SAX.h>
#include <libxml/uri.h>
#include <libxml/valid.h>
#include <libxml/HTMLtree.h>
#include <libxml/globals.h>
#include <libxml/SAX2.h>
#ifdef LIBXML_LEGACY_ENABLED
#ifdef LIBXML_SAX1_ENABLED
/**
* initxmlDefaultSAXHandler:
* @hdlr: the SAX handler
* @warning: flag if non-zero sets the handler warning procedure
*
* Initialize the default XML SAX version 1 handler
* DEPRECATED: use xmlSAX2InitDefaultSAXHandler() for the new SAX2 blocks
*/
void
initxmlDefaultSAXHandler(xmlSAXHandlerV1 *hdlr, int warning)
{
if(hdlr->initialized == 1)
return;
hdlr->internalSubset = xmlSAX2InternalSubset;
hdlr->externalSubset = xmlSAX2ExternalSubset;
hdlr->isStandalone = xmlSAX2IsStandalone;
hdlr->hasInternalSubset = xmlSAX2HasInternalSubset;
hdlr->hasExternalSubset = xmlSAX2HasExternalSubset;
hdlr->resolveEntity = xmlSAX2ResolveEntity;
hdlr->getEntity = xmlSAX2GetEntity;
hdlr->getParameterEntity = xmlSAX2GetParameterEntity;
hdlr->entityDecl = xmlSAX2EntityDecl;
hdlr->attributeDecl = xmlSAX2AttributeDecl;
hdlr->elementDecl = xmlSAX2ElementDecl;
hdlr->notationDecl = xmlSAX2NotationDecl;
hdlr->unparsedEntityDecl = xmlSAX2UnparsedEntityDecl;
hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
hdlr->startDocument = xmlSAX2StartDocument;
hdlr->endDocument = xmlSAX2EndDocument;
hdlr->startElement = xmlSAX2StartElement;
hdlr->endElement = xmlSAX2EndElement;
hdlr->reference = xmlSAX2Reference;
hdlr->characters = xmlSAX2Characters;
hdlr->cdataBlock = xmlSAX2CDataBlock;
hdlr->ignorableWhitespace = xmlSAX2Characters;
hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
if (warning == 0)
hdlr->warning = NULL;
else
hdlr->warning = xmlParserWarning;
hdlr->error = xmlParserError;
hdlr->fatalError = xmlParserError;
hdlr->initialized = 1;
}
#ifdef LIBXML_HTML_ENABLED
/**
* inithtmlDefaultSAXHandler:
* @hdlr: the SAX handler
*
* Initialize the default HTML SAX version 1 handler
* DEPRECATED: use xmlSAX2InitHtmlDefaultSAXHandler() for the new SAX2 blocks
*/
void
inithtmlDefaultSAXHandler(xmlSAXHandlerV1 *hdlr)
{
if(hdlr->initialized == 1)
return;
hdlr->internalSubset = xmlSAX2InternalSubset;
hdlr->externalSubset = NULL;
hdlr->isStandalone = NULL;
hdlr->hasInternalSubset = NULL;
hdlr->hasExternalSubset = NULL;
hdlr->resolveEntity = NULL;
hdlr->getEntity = xmlSAX2GetEntity;
hdlr->getParameterEntity = NULL;
hdlr->entityDecl = NULL;
hdlr->attributeDecl = NULL;
hdlr->elementDecl = NULL;
hdlr->notationDecl = NULL;
hdlr->unparsedEntityDecl = NULL;
hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
hdlr->startDocument = xmlSAX2StartDocument;
hdlr->endDocument = xmlSAX2EndDocument;
hdlr->startElement = xmlSAX2StartElement;
hdlr->endElement = xmlSAX2EndElement;
hdlr->reference = NULL;
hdlr->characters = xmlSAX2Characters;
hdlr->cdataBlock = xmlSAX2CDataBlock;
hdlr->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
hdlr->comment = xmlSAX2Comment;
hdlr->warning = xmlParserWarning;
hdlr->error = xmlParserError;
hdlr->fatalError = xmlParserError;
hdlr->initialized = 1;
}
#endif /* LIBXML_HTML_ENABLED */
#ifdef LIBXML_DOCB_ENABLED
/**
* initdocbDefaultSAXHandler:
* @hdlr: the SAX handler
*
* Initialize the default DocBook SAX version 1 handler
* DEPRECATED: use xmlSAX2InitDocbDefaultSAXHandler() for the new SAX2 blocks
*/
void
initdocbDefaultSAXHandler(xmlSAXHandlerV1 *hdlr)
{
if(hdlr->initialized == 1)
return;
hdlr->internalSubset = xmlSAX2InternalSubset;
hdlr->externalSubset = NULL;
hdlr->isStandalone = xmlSAX2IsStandalone;
hdlr->hasInternalSubset = xmlSAX2HasInternalSubset;
hdlr->hasExternalSubset = xmlSAX2HasExternalSubset;
hdlr->resolveEntity = xmlSAX2ResolveEntity;
hdlr->getEntity = xmlSAX2GetEntity;
hdlr->getParameterEntity = NULL;
hdlr->entityDecl = xmlSAX2EntityDecl;
hdlr->attributeDecl = NULL;
hdlr->elementDecl = NULL;
hdlr->notationDecl = NULL;
hdlr->unparsedEntityDecl = NULL;
hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
hdlr->startDocument = xmlSAX2StartDocument;
hdlr->endDocument = xmlSAX2EndDocument;
hdlr->startElement = xmlSAX2StartElement;
hdlr->endElement = xmlSAX2EndElement;
hdlr->reference = xmlSAX2Reference;
hdlr->characters = xmlSAX2Characters;
hdlr->cdataBlock = NULL;
hdlr->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
hdlr->processingInstruction = NULL;
hdlr->comment = xmlSAX2Comment;
hdlr->warning = xmlParserWarning;
hdlr->error = xmlParserError;
hdlr->fatalError = xmlParserError;
hdlr->initialized = 1;
}
#endif /* LIBXML_DOCB_ENABLED */
#endif /* LIBXML_SAX1_ENABLED */
#define bottom_SAX
#include "elfgcchack.h"
#endif /* LIBXML_LEGACY_ENABLED */

2849
reactos/lib/libxml2/SAX2.c Normal file

File diff suppressed because it is too large Load diff

278
reactos/lib/libxml2/TODO Normal file
View file

@ -0,0 +1,278 @@
124907 HTML parse buffer problem when parsing larse in-memory docs
124110 DTD validation && wrong namespace
123564 xmllint --html --format
TODO for the XML parser and stuff:
==================================
$Id: TODO,v 1.44 2005/01/07 13:56:19 veillard Exp $
this tend to be outdated :-\ ...
DOCS:
=====
- use case of using XInclude to load for example a description.
order document + product base -(XSLT)-> quote with XIncludes
|
HTML output with description of parts <---(XSLT)--
TODO:
=====
- XInclude at the SAX level (libSRVG)
- fix the C code prototype to bring back doc/libxml-undocumented.txt
to a reasonable level
- Computation of base when HTTP redirect occurs, might affect HTTP
interfaces.
- Computation of base in XInclude. Relativization of URIs.
- listing all attributes in a node.
- Better checking of external parsed entities TAG 1234
- Go through erratas and do the cleanup.
http://www.w3.org/XML/xml-19980210-errata ... started ...
- jamesh suggestion: SAX like functions to save a document ie. call a
function to open a new element with given attributes, write character
data, close last element, etc
+ inversted SAX, initial patch in April 2002 archives.
- htmlParseDoc has parameter encoding which is not used.
Function htmlCreateDocParserCtxt ignore it.
- fix realloc() usage.
- Stricten the UTF8 conformance (Martin Duerst):
http://www.w3.org/2001/06/utf-8-test/.
The bad files are in http://www.w3.org/2001/06/utf-8-wrong/.
- xml:id normalized value
TODO:
=====
- move all string manipulation functions (xmlStrdup, xmlStrlen, etc.) to
global.c. Bjorn noted that the following files depends on parser.o solely
because of these string functions: entities.o, global.o, hash.o, tree.o,
xmlIO.o, and xpath.o.
- Optimization of tag strings allocation ?
- maintain coherency of namespace when doing cut'n paste operations
=> the functions are coded, but need testing
- function to rebuild the ID table
- functions to rebuild the DTD hash tables (after DTD changes).
EXTENSIONS:
===========
- Tools to produce man pages from the SGML docs.
- Add Xpointer recognition/API
- Add Xlink recognition/API
=> started adding an xlink.[ch] with a unified API for XML and HTML.
it's crap :-(
- Implement XSchemas
=> Really need to be done <grin/>
- datatype are complete, but structure support is very limited.
- extend the shell with:
- edit
- load/save
- mv (yum, yum, but it's harder because directories are ordered in
our case, mvup and mvdown would be required)
Done:
=====
- Add HTML validation using the XHTML DTD
- problem: do we want to keep and maintain the code for handling
DTD/System ID cache directly in libxml ?
=> not really done that way, but there are new APIs to check elements
or attributes. Otherwise XHTML validation directly ...
- XML Schemas datatypes except Base64 and BinHex
- Relax NG validation
- XmlTextReader streaming API + validation
- Add a DTD cache prefilled with xhtml DTDs and entities and a program to
manage them -> like the /usr/bin/install-catalog from SGML
right place seems $datadir/xmldtds
Maybe this is better left to user apps
=> use a catalog instead , and xhtml1-dtd package
- Add output to XHTML
=> XML serializer automatically recognize the DTd and apply the specific
rules.
- Fix output of <tst val="x&#xA;y"/>
- compliance to XML-Namespace checking, see section 6 of
http://www.w3.org/TR/REC-xml-names/
- Correct standalone checking/emitting (hard)
2.9 Standalone Document Declaration
- Implement OASIS XML Catalog support
http://www.oasis-open.org/committees/entity/
- Get OASIS testsuite to a more friendly result, check all the results
once stable. the check-xml-test-suite.py script does this
- Implement XSLT
=> libxslt
- Finish XPath
=> attributes addressing troubles
=> defaulted attributes handling
=> namespace axis ?
done as XSLT got debugged
- bug reported by Michael Meallin on validation problems
=> Actually means I need to add support (and warn) for non-deterministic
content model.
- Handle undefined namespaces in entity contents better ... at least
issue a warning
- DOM needs
int xmlPruneProp(xmlNodePtr node, xmlAtttrPtr attr);
=> done it's actually xmlRemoveProp xmlUnsetProp xmlUnsetNsProp
- HTML: handling of Script and style data elements, need special code in
the parser and saving functions (handling of < > " ' ...):
http://www.w3.org/TR/html4/types.html#type-script
Attributes are no problems since entities are accepted.
- DOM needs
xmlAttrPtr xmlNewDocProp(xmlDocPtr doc, const xmlChar *name, const xmlChar *value)
- problem when parsing hrefs with & with the HTML parser (IRC ac)
- If the internal encoding is not UTF8 saving to a given encoding doesn't
work => fix to force UTF8 encoding ...
done, added documentation too
- Add an ASCII I/O encoder (asciiToUTF8 and UTF8Toascii)
- Issue warning when using non-absolute namespaces URI.
- the html parser should add <head> and <body> if they don't exist
started, not finished.
Done, the automatic closing is added and 3 testcases were inserted
- Command to force the parser to stop parsing and ignore the rest of the file.
xmlStopParser() should allow this, mostly untested
- support for HTML empty attributes like <hr noshade>
- plugged iconv() in for support of a large set of encodings.
- xmlSwitchToEncoding() rewrite done
- URI checkings (no fragments) rfc2396.txt
- Added a clean mechanism for overload or added input methods:
xmlRegisterInputCallbacks()
- dynamically adapt the alloc entry point to use g_alloc()/g_free()
if the programmer wants it:
- use xmlMemSetup() to reset the routines used.
- Check attribute normalization especially xmlGetProp()
- Validity checking problems for NOTATIONS attributes
- Validity checking problems for ENTITY ENTITIES attributes
- Parsing of a well balanced chunk xmlParseBalancedChunkMemory()
- URI module: validation, base, etc ... see uri.[ch]
- turn tester into a generic program xmllint installed with libxml
- extend validity checks to go through entities content instead of
just labelling them PCDATA
- Save Dtds using the children list instead of dumping the tables,
order is preserved as well as comments and PIs
- Wrote a notice of changes requires to go from 1.x to 2.x
- make sure that all SAX callbacks are disabled if a WF error is detected
- checking/handling of newline normalization
http://localhost/www.xml.com/axml/target.html#sec-line-ends
- correct checking of '&' '%' on entities content.
- checking of PE/Nesting on entities declaration
- checking/handling of xml:space
- checking done.
- handling done, not well tested
- Language identification code, productions [33] to [38]
=> done, the check has been added and report WFness errors
- Conditional sections in DTDs [61] to [65]
=> should this crap be really implemented ???
=> Yep OASIS testsuite uses them
- Allow parsed entities defined in the internal subset to override
the ones defined in the external subset (DtD customization).
=> This mean that the entity content should be computed only at
use time, i.e. keep the orig string only at parse time and expand
only when referenced from the external subset :-(
Needed for complete use of most DTD from Eve Maler
- Add regression tests for all WFC errors
=> did some in test/WFC
=> added OASIS testsuite routines
http://xmlsoft.org/conf/result.html
- I18N: http://wap.trondheim.com/vaer/index.phtml is not XML and accepted
by the XML parser, UTF-8 should be checked when there is no "encoding"
declared !
- Support for UTF-8 and UTF-16 encoding
=> added some convertion routines provided by Martin Durst
patched them, got fixes from @@@
I plan to keep everything internally as UTF-8 (or ISO-Latin-X)
this is slightly more costly but more compact, and recent processors
efficiency is cache related. The key for good performances is keeping
the data set small, so will I.
=> the new progressive reading routines call the detection code
is enabled, tested the ISO->UTF-8 stuff
- External entities loading:
- allow override by client code
- make sure it is alled for all external entities referenced
Done, client code should use xmlSetExternalEntityLoader() to set
the default loading routine. It will be called each time an external
entity entity resolution is triggered.
- maintain ID coherency when removing/changing attributes
The function used to deallocate attributes now check for it being an
ID and removes it from the table.
- push mode parsing i.e. non-blocking state based parser
done, both for XML and HTML parsers. Use xmlCreatePushParserCtxt()
and xmlParseChunk() and html counterparts.
The tester program now has a --push option to select that parser
front-end. Douplicated tests to use both and check results are similar.
- Most of XPath, still see some troubles and occasionnal memleaks.
- an XML shell, allowing to traverse/manipulate an XML document with
a shell like interface, and using XPath for the anming syntax
- use of readline and history added when available
- the shell interface has been cleanly separated and moved to debugXML.c
- HTML parser, should be fairly stable now
- API to search the lang of an attribute
- Collect IDs at parsing and maintain a table.
PBM: maintain the table coherency
PBM: how to detect ID types in absence of DtD !
- Use it for XPath ID support
- Add validity checking
Should be finished now !
- Add regression tests with entity substitutions
- External Parsed entities, either XML or external Subset [78] and [79]
parsing the xmllang DtD now works, so it should be sufficient for
most cases !
- progressive reading. The entity support is a first step toward
asbtraction of an input stream. A large part of the context is still
located on the stack, moving to a state machine and putting everyting
in the parsing context should provide an adequate solution.
=> Rather than progressive parsing, give more power to the SAX-like
interface. Currently the DOM-like representation is built but
=> it should be possible to define that only as a set of SAX callbacks
and remove the tree creation from the parser code.
DONE
- DOM support, instead of using a proprietary in memory
format for the document representation, the parser should
call a DOM API to actually build the resulting document.
Then the parser becomes independent of the in-memory
representation of the document. Even better using RPC's
the parser can actually build the document in another
program.
=> Work started, now the internal representation is by default
very near a direct DOM implementation. The DOM glue is implemented
as a separate module. See the GNOME gdome module.
- C++ support : John Ehresman <jehresma@dsg.harvard.edu>
- Updated code to follow more recent specs, added compatibility flag
- Better error handling, use a dedicated, overridable error
handling function.
- Support for CDATA.
- Keep track of line numbers for better error reporting.
- Support for PI (SAX one).
- Support for Comments (bad, should be in ASAP, they are parsed
but not stored), should be configurable.
- Improve the support of entities on save (+SAX).

View file

@ -0,0 +1,31 @@
- implement counted transitions at the automata level
- Unicode:
+ upgrade to 3.2
+ improve the python script to generate better test
expressions to check the list of ranges.
- Implement the interface at the SAX level
- Implement the missing parts in the Structure part
+ all content model
+ enumerations
+ countless others c.f. the TODO scattered in the code
- Complete the Built-In datatype collections and Facets implementations
- Regression tests based on
+ the primer:
http://www.w3.org/TR/xmlschema-0/
+ the Schemas Test Collection:
http://www.w3.org/2001/05/xmlschema-test-collection/
+ archives of the schemas-dev list
- Integrity constraints:
+ what's that ? How need to read about it
- "formal" checking, i.e. go through the full Structure spec and
bind code and associated parts of the Schemas spec
- go though the erratas
http://www.w3.org/2001/05/xmlschema-errata

View file

@ -0,0 +1,16 @@
#undef PACKAGE
#undef VERSION
#undef HAVE_LIBZ
#undef HAVE_LIBM
#undef HAVE_ISINF
#undef HAVE_ISNAN
#undef HAVE_LIBHISTORY
#undef HAVE_LIBREADLINE
#undef HAVE_LIBPTHREAD
#undef HAVE_PTHREAD_H
/* Define if IPV6 support is there */
#undef SUPPORT_IP6
/* Define if getaddrinfo is there */
#undef HAVE_GETADDRINFO

View file

@ -0,0 +1,28 @@
dnl Like AC_TRY_EVAL but also errors out if the compiler generates
dnl _any_ output. Some compilers might issue warnings which we want
dnl to catch.
AC_DEFUN([AC_TRY_EVAL2],
[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AC_FD_CC; dnl
(eval [$]$1) 2>&AC_FD_CC; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }])
dnl Like AC_TRY_COMPILE but calls AC_TRY_EVAL2 instead of AC_TRY_EVAL
AC_DEFUN([AC_TRY_COMPILE2],
[cat > conftest.$ac_ext <<EOF
[#]line __oline__ "configure"
#include "confdefs.h"
[$1]
int main(void) {
[$2]
; return 0; }
EOF
if AC_TRY_EVAL2(ac_compile); then
ifelse([$3], , :, [rm -rf conftest*
$3])
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
ifelse([$4], , , [ rm -rf conftest*
$4
])dnl
fi
rm -f conftest*])

7007
reactos/lib/libxml2/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,15 @@
<?xml version="1.0" ?>
<!-- $Id: Bakefiles.bkgen,v 1.1 2005/01/27 23:59:14 veillard Exp $ -->
<bakefile-gen>
<disable-formats>gnu,dmars,cbx_unix,cbuilderx</disable-formats>
<input>libxml2.bkl</input>
<!-- List of output formats to generate: -->
<add-formats>
borland,dmars,mingw,msvc,msvc6prj,watcom,cbuilderx,cbx_unix,gnu
</add-formats>
</bakefile-gen>

View file

@ -0,0 +1,92 @@
LIBXML2 build system for Win32 README
-------------------------------------
In this folder are stored all the files required to compile LIBXML2 with win32 compilers.
Bakefile (http://bakefile.sourceforge.net) is used as makefile generator.
Supported makefiles:
- makefile.vc for Microsoft NMAKE
- makefile.bcc for Borland MAKE
- makefile.wat for OpenWatcom MAKE
- makefile.gcc for MinGW MINGW32-MAKE
- all DSP & DSW for Microsoft VisualC++ 6.0 (can be used also with VS.NET AFAIK)
This readme is organized as:
1.0 HOWTO compile LIBXML2 using makefiles <-- for users who want to build the library using *command-line*
1.1 HOWTO compile LIBXML2 using an IDE <-- for users who want to build the library using an *IDE*
1.2 HOWTO regenerate makefiles for LIBXML2 <-- for libxml2 mantainers/developers/advanced users
If you just want to compile the library (and the test programs) you should definitely avoid the
section 1.1 and focus on the 1.0.
1.0 HOWTO compile LIBXML2 using makefiles
-----------------------------------------
Choose your preferred compiler among those actually supported (see above) and then run
mycompilermake -fmakefile.makefileext [options]
for a full list of the available options you should open with a notepad (or something like that)
the makefile you want to use; at the beginning you should see a section which starts as:
# -------------------------------------------------------------------------
# These are configurable options:
# -------------------------------------------------------------------------
here you can find all the options actually used by that makefile.
They can be customized when running the makefile writing something like:
nmake -fmakefile.vc BUILD=release
mingw32-make -fmakefile.gcc BUILD=debug ICONV_DIR=c:\myiconv
or they can be permanently changed modifying the makefile.
That's all: for any problem/compile-error/suggestion, write to
frm@users.sourceforge.net with the word "libxml2" in the subject.
1.1 HOWTO compile LIBXML2 using an IDE
--------------------------------------
Actually only the Microsoft VisualC++ 6.0 project files are generated.
In future other Integrated Development Environments (IDEs) will be supported as well.
With MSVC++ 6.0, you should open the DSW file and then set as the active project the
"libxml2" project, if you want to build the library or one of the test projects if you
want to run them.
Using the command "Build->Set Active Configuration" you can choose one of the predefined
configuration.
1.2 HOWTO regenerate makefiles for LIBXML2
------------------------------------------
Be sure to have installed Bakefile (http://bakefile.sourceforge.net).
Just run the "bakefile_gen" command inside the folder containing the "libxml2.bkl" file.
NOTE: if you want to remove all the makefiles, you can use the "bakefile_gen -c" command.
The template files used to generate all makefiles are only two:
- libxml2.bkl (the main one)
- Bakefiles.bkgen
All the other files can be dinamically regenerated.
If you have problems with the compilation of LIBXML2 under windows (using one of the supported compiler)
please write to:
Francesco Montorsi <frm@users.sourceforge.net>

View file

@ -0,0 +1,749 @@
<?xml version="1.0" ?>
<!-- Author: Francesco Montorsi <frm@users.sourceforge.net> -->
<!-- Date: 30/8/2004 -->
<!-- Last revision: 26/1/2005 -->
<!-- LIBXML2 BAKEFILE -->
<!-- -->
<!-- The bakefile used to build the library and the test -->
<!-- programs. The makefiles output is put: -->
<!-- -->
<!-- - in the ..\LIB folder -->
<!-- - in the ..\BIN folder -->
<!-- -->
<makefile>
<using module="datafiles"/>
<requires version="0.1.5"/>
<!-- This is a bakefile, that is, a generic template used to -->
<!-- generate makefiles ALL supported compilers. -->
<!-- To use this project file you need Bakefile installed. -->
<!-- With the command "bakefile_gen" you can regen all the -->
<!-- makefiles and project files. -->
<!-- See http://bakefile.sourceforge.net for more info. -->
<!--
This file is divided in:
- generic options
- generic variables
- libxml2 options
- libxml2 variables
- about config.h creation
- templates
- libxml2 library target
- libxml2 test program targets
-->
<!-- -->
<!-- GENERIC OPTIONS -->
<!-- -->
<!-- This is a standard option that determines -->
<!-- whether the user wants to build this library as -->
<!-- a dll or as a static library. -->
<option name="SHARED">
<values>0,1</values>
<values-description>,DLL</values-description>
<default-value>0</default-value>
<description>If set to zero a STATIC libxml library will be built</description>
</option>
<!-- Configuration for building the bakefile with -->
<!-- unicode strings or not (unicode or ansi). -->
<option name="UNICODE">
<values>0,1</values>
<values-description>,Unicode</values-description>
<default-value>0</default-value>
<description>Compile Unicode build?</description>
</option>
<!-- There are several options that deal with build -->
<!-- types. First, there's this one, BUILD. -->
<!-- -->
<!-- BUILD determines whether or not we want to build -->
<!-- in release or debug mode. Note that in practice -->
<!-- this means modifying the optimize tag, which by -->
<!-- default is set to off. In this case debug means -->
<!-- off (no optimizations), and release means speed -->
<!-- (fast with inlining). There is also a size option -->
<!-- that is not addressed in this example bakefile. -->
<option name="BUILD">
<values>debug,release</values>
<values-description>Debug,Release</values-description>
<default-value>release</default-value>
<description>
Type of compiled binaries
</description>
</option>
<!-- -->
<!-- GENERIC VARIABLES -->
<!-- -->
<!-- Set the ISDLL variable, so that we can use it -->
<!-- inside an if statement later on (options not -->
<!-- allowed in if statements). -->
<set var="ISDLL" cond="SHARED=='1'">1</set>
<set var="ISDLL" cond="SHARED=='0'">0</set>
<!-- The unicode define we want. By default bakefile -->
<!-- makes variables an empty string, so if unicode -->
<!-- is not defined $(UNICODE_DEFINE) would expand -->
<!-- to nothing (literally). -->
<set var="UNICODE_DEFINE">
<if cond="FORMAT!='autoconf' and UNICODE=='1'">_UNICODE</if>
</set>
<!-- The debug define we need with win32 compilers -->
<!-- (on Linux, the wx-config program is used). -->
<set var="DEBUG_DEFINE">
<if cond="FORMAT!='autoconf' and BUILD=='debug'">
__WXDEBUG__
</if>
</set>
<!-- Value we will use later on for the debug-info -->
<!-- tag inside our templates. -->
<set var="DEBUGINFO">
<if cond="BUILD=='debug'">on</if>
<if cond="BUILD=='release'">off</if>
</set>
<!-- Value we will use later on for the debug-runtime -->
<!-- tag inside our templates. -->
<set var="DEBUGRUNTIME">
<if cond="BUILD=='debug'">on</if>
<if cond="BUILD=='release'">off</if>
</set>
<!-- Value for optimize tag. -->
<set var="OPTIMIZEFLAG">
<if cond="BUILD=='debug'">off</if>
<if cond="BUILD=='release'">speed</if>
</set>
<!-- Level of warnings. Here we max it out in debug -->
<!-- mode, and turn them off in release mode. -->
<set var="WARNINGS">
<if cond="BUILD=='debug'">max</if>
<if cond="BUILD=='release'">no</if>
</set>
<!-- Set MYCPPFLAGS as empty; maybe it will be filled later... -->
<set var="MYCPPFLAGS"></set>
<if cond="FORMAT=='mingw' or FORMAT=='autoconf'">
<!-- With GCC, settings warnings to MAX would force -->
<!-- Bakefile to call GCC with "-W -Wall" which generates -->
<!-- a *lot* of warnings about wxWidgets headers... -->
<!-- this is why "-W -Wall" is here replaced by "-Wall". -->
<set var="WARNINGS">default</set>
<set var="MYCPPFLAGS">-Wall</set>
</if>
<!-- -->
<!-- LIBXML2 OPTIONS -->
<!-- -->
<!-- Note #1: not all of them are used by win32 makefiles -->
<!-- -->
<!-- Note #2: since all combinations of non-path options are -->
<!-- translated into different 'configurations' by -->
<!-- Bakefile when using the MSVC6PRJ output, we must -->
<!-- avoid to create a 10 MB libxml2.dsp file forcing -->
<!-- some options to their default values... this -->
<!-- behaviour can be overridden by the -->
<!-- FULL_OPTIONS_SUPPORT -->
<!-- variable defined below... -->
<set var="FULL_OPTIONS_SUPPORT">
<if cond="FORMAT=='msvc6prj'">0</if>
<if cond="FORMAT!='msvc6prj'">1</if>
</set>
<option name="ICONV_DIR" category="path">
<default-value>c:\iconv</default-value>
<description>The iconv library main folder</description>
</option>
<option name="WITH_TRIO">
<values>0,1</values>
<default-value>0</default-value>
<description>Enable TRIO string manipulator</description>
</option>
<!-- see the note #2 -->
<if cond="FULL_OPTIONS_SUPPORT=='0'">
<set var="WITH_THREADS">native</set>
</if>
<if cond="FULL_OPTIONS_SUPPORT=='1'">
<option name="WITH_THREADS">
<values>no,ctls,native,posix</values>
<default-value>native</default-value>
<description>Enable thread safety</description>
</option>
</if>
<option name="WITH_FTP">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable FTP client</description>
</option>
<option name="WITH_HTTP">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable HTTP client</description>
</option>
<option name="WITH_C14N">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable C14N support</description>
</option>
<option name="WITH_CATALOG">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable catalog support</description>
</option>
<option name="WITH_DOCB">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable DocBook support</description>
</option>
<option name="WITH_XPATH">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable XPath support</description>
</option>
<option name="WITH_XPTR">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable XPointer support</description>
</option>
<option name="WITH_XINCLUDE">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable XInclude support</description>
</option>
<!-- see the note #2 -->
<if cond="FULL_OPTIONS_SUPPORT=='0'">
<set var="WITH_ICONV">1</set>
</if>
<if cond="FULL_OPTIONS_SUPPORT=='1'">
<option name="WITH_ICONV">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable iconv support</description>
</option>
</if>
<option name="WITH_ISO8859X">
<values>0,1</values>
<default-value>0</default-value>
<description>Enable iso8859x support</description>
</option>
<!-- see the note #2 -->
<if cond="FULL_OPTIONS_SUPPORT=='0'">
<set var="WITH_ZLIB">0</set>
</if>
<if cond="FULL_OPTIONS_SUPPORT=='1'">
<option name="WITH_ZLIB">
<values>0,1</values>
<default-value>0</default-value>
<description>Enable ZLIB support</description>
</option>
</if>
<option name="WITH_REGEXPS">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable regular expressions</description>
</option>
<option name="WITH_TREE">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable tree api</description>
</option>
<option name="WITH_READER">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable xmlReader api</description>
</option>
<option name="WITH_WRITER">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable xmlWriter api</description>
</option>
<option name="WITH_WALKER">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable xmlDocWalker api</description>
</option>
<option name="WITH_PATTERN">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable xmlPattern api</description>
</option>
<option name="WITH_PUSH">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable push api</description>
</option>
<option name="WITH_VALID">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable DTD validation support</description>
</option>
<option name="WITH_SAX1">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable SAX1 api</description>
</option>
<option name="WITH_SCHEMAS">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable XML Schema support</description>
</option>
<option name="WITH_LEGACY">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable deprecated APIs</description>
</option>
<option name="WITH_OUTPUT">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable serialization support</description>
</option>
<option name="WITH_PYTHON">
<values>0,1</values>
<default-value>0</default-value>
<description>Build Python bindings</description>
</option>
<!-- -->
<!-- LIBXML2 VARIABLES -->
<!-- -->
<!-- Put all the objects files generated by -->
<!-- the compilation in a subfolder of BUILD -->
<set var="BUILDDIR">$(FORMAT)</set>
<!-- This variable is set to 1 when the current output writer supports -->
<!-- the __DEFINE_ARG variable. Otherwise it's set to zero. -->
<set var="HAS_DEFINE_ARG">
<if cond="FORMAT!='msvc6prj'">1</if>
<if cond="FORMAT=='msvc6prj'">0</if>
</set>
<!-- The root directory of libxml2 -->
<set var="XMLBASEDIR">..</set>
<!-- The directory where libxml2' tests will be put -->
<set var="XMLTESTDIR">$(XMLBASEDIR)$(DIRSEP)bin</set>
<set var="LIBXML_MAJOR_VERSION">2</set>
<set var="LIBXML_MINOR_VERSION">6</set>
<set var="LIBXML_MICRO_VERSION">16</set>
<!-- some defines related to threads -->
<set var="THREADS_DEF">
<if cond="HAS_DEFINE_ARG=='1' and WITH_THREADS=='native'">
$(__DEFINE_ARG)_REENTRANT $(__DEFINE_ARG)HAVE_WIN32_THREADS
</if>
<if cond="HAS_DEFINE_ARG=='1' and WITH_THREADS=='ctls'">
$(__DEFINE_ARG)_REENTRANT $(__DEFINE_ARG)HAVE_WIN32_THREADS $(__DEFINE_ARG)HAVE_COMPILER_TLS
</if>
<if cond="HAS_DEFINE_ARG=='1' and WITH_THREADS=='posix'">
$(__DEFINE_ARG)_REENTRANT $(__DEFINE_ARG)HAVE_PTHREAD_H
</if>
</set>
<if cond="FORMAT=='borland'">
<set var="THREADS_DEF">
<if cond="WITH_THREADS=='native'">$(THREADS_DEF) $(__DEFINE_ARG)__MT__</if>
<if cond="WITH_THREADS=='ctls'">$(THREADS_DEF) $(__DEFINE_ARG)__MT__</if>
<if cond="WITH_THREADS=='posix'">$(THREADS_DEF) $(__DEFINE_ARG)__MT__</if>
</set>
</if>
<!-- some other conditional defines -->
<set var="ZLIB_DEF"><if cond="WITH_ZLIB=='1'">HAVE_ZLIB_H</if></set>
<set var="DEBUG_DEF"><if cond="BUILD=='debug'">_DEBUG</if></set>
<set var="DEBUG_DEF"><if cond="BUILD=='release'">NDEBUG</if></set>
<!-- this is very very important when compiling with MINGW: without this line,
the test programs (and all the programs built with libxml2 which use xmlFree)
won't build because of "undefined references to __xmlFree" -->
<set var="STATIC_DEF"><if cond="SHARED=='0'">LIBXML_STATIC</if></set>
<!-- some conditional libraries dependencies -->
<set var="ICONV_LIB"><if cond="WITH_ICONV=='1'">iconv</if></set>
<set var="WSOCK32_LIB"><if cond="WITH_THREADS=='native'">wsock32</if></set>
<set var="ZLIB_LIB"><if cond="WITH_ZLIB=='1'">zdll</if></set>
<set var="POSIX_LIB"><if cond="WITH_THREADS=='posix'">pthreadVC</if></set>
<set var="XMLINCLUDEDIR">$(XMLBASEDIR)$(DIRSEP)include$(DIRSEP)libxml$(DIRSEP)</set>
<!-- -->
<!-- ABOUT CONFIG.H HEADER CREATION -->
<!-- -->
<set var="CONFIG_SRCNAME">win32config.h</set>
<set var="CONFIG_DSTNAME">config.h</set>
<if cond="FORMAT!='msvc6prj' and FORMAT!='autoconf' and FORMAT!='gnu'">
<copy-file-to-file id="setup">
<!-- On win32 we need to manually copy a default config.h file -->
<!-- from the include/mc/msw folder to include/mc -->
<src>../include/$(CONFIG_SRCNAME)</src>
<dst>../$(CONFIG_DSTNAME)</dst>
<dependency-of>all</dependency-of>
<!-- With autoconf, we will use the configure script to translate -->
<!-- include/mc/config.h.in to include/mc/config.h and thus we do -->
<!-- not need to do anything here... -->
</copy-file-to-file>
</if>
<if cond="FORMAT!='msvc6prj'">
<mkdir id="setuplibdir"><dir>$(XMLBASEDIR)$(DIRSEP)lib</dir></mkdir>
<mkdir id="setupbindir"><dir>$(XMLBASEDIR)$(DIRSEP)bin</dir></mkdir>
<!-- Creates all output folders -->
<phony id="setupdirs">
<dependency-of>all</dependency-of>
<depends>setuplibdir</depends>
<depends>setupbindir</depends>
</phony>
</if>
<!-- This defines a tag which includes headers on MSVC -->
<!-- Note that $(value) is stuck in there by bakefile, -->
<!-- and is the value between the beginning and end tag. -->
<define-tag name="headers" rules="dll,lib,exe">
<if cond="FORMAT=='msvc6prj'">
<msvc-project-files>
$(value)
</msvc-project-files>
</if>
</define-tag>
<!-- Creates the following custom build rule for MSVC6PRJ file:
copies ..\include\win32config.h into ..\config.h
NOTE: this tag must be used before the <sources> tag if you want that the configuration
file will be created before any other source file is compiled... -->
<define-tag name="msvc-copy-setup-h" rules="dll,lib,action">
<if cond="FORMAT=='msvc6prj'">
<headers>$(XMLBASEDIR)\include\$(CONFIG_SRCNAME)</headers>
<set var="__subdir">$(value)</set>
<set var="_custom_build_files" append="1">$(XMLBASEDIR)\include\$(CONFIG_SRCNAME)</set>
<set var="_custom_build____include_win32config_h">
Creating the configuration file ..\$(CONFIG_DSTNAME) from ..\include\win32\$(CONFIG_SRCNAME)
InputPath=..\include\$(CONFIG_SRCNAME)
"..\include\$(CONFIG_SRCNAME)" : $(DOLLAR)(SOURCE) "$(DOLLAR)(INTDIR)" "$(DOLLAR)(OUTDIR)"
$(TAB)copy "$(DOLLAR)(InputPath)" ..\$(CONFIG_DSTNAME)
</set>
</if>
</define-tag>
<!-- -->
<!-- TEMPLATES -->
<!-- -->
<!-- The basic template: used by all the targets -->
<template id="base">
<if cond="FORMAT=='mingw'">
<define>HAVE_W32API_H</define>
<ldflags>-mthreads</ldflags>
</if>
<cxxflags>$(MYCPPFLAGS)</cxxflags>
<warnings>$(WARNINGS)</warnings>
<define>$(UNICODE_DEFINE)</define>
<optimize>$(OPTIMIZEFLAG)</optimize>
<debug-info>$(DEBUGINFO)</debug-info>
<debug-runtime-libs>$(DEBUGRUNTIME)</debug-runtime-libs>
</template>
<!-- The template used both by the library and by the test programs -->
<template id="xml2" template="base">
<!-- -I & -L equivalents -->
<include>$(XMLBASEDIR)$(DIRSEP)include</include>
<include>$(ICONV_DIR)$(DIRSEP)include</include>
<lib-path>$(ICONV_DIR)$(DIRSEP)lib</lib-path>
<!-- some conditional define flags -->
<cflags>$(THREADS_DEF)</cflags>
<define>$(ZLIB_DEF)</define>
<define>$(DEBUG_DEF)</define>
<define>$(STATIC_DEF)</define>
<if cond="HAS_DEFINE_ARG=='0'">
<!-- we are probably using an IDE output: defaults to WITH_THREADS=='native' -->
<define>_REENTRANT</define>
<define>HAVE_WIN32_THREADS</define>
</if>
<!-- these must always be defined on win32 -->
<define>WIN32</define>
<define>_WINDOWS</define>
<define>_MBCS</define>
<if cond="FORMAT=='borland'">
<define>_NO_VCL</define>
<define>EILSEQ=2</define>
</if>
</template>
<!-- The template used by libxml2 test programs -->
<template id="xml2test" template="xml2">
<dirname>$(XMLTESTDIR)</dirname>
<app-type>console</app-type>
<library>libxml2</library>
<sys-lib>$(ICONV_LIB)</sys-lib>
<sys-lib>$(WSOCK32_LIB)</sys-lib>
<sys-lib>$(ZLIB_LIB)</sys-lib>
<sys-lib>$(POSIX_LIB)</sys-lib>
</template>
<!-- -->
<!-- LIBXML2 LIBRARY TARGET -->
<!-- -->
<lib id="libxml2" template="xml2">
<!-- this is useful only when using MSVC6PRJ -->
<if cond="FORMAT=='msvc6prj'">
<msvc-copy-setup-h/>
<msvc-file-group>Config headers:*config.h</msvc-file-group>
</if>
<if cond="FORMAT!='msvc6prj'">
<depends>setup</depends>
<depends>setuplibdir</depends>
</if>
<!-- output folder -->
<dirname>$(XMLBASEDIR)$(DIRSEP)lib</dirname>
<!-- The output name must be "libxml2.lib" with all compilers.
Since mingw format autoadds the "lib" prefix to the library
name, we must intercept that case to avoid to get "liblibxml2.a" -->
<if cond="FORMAT!='mingw'">
<libname>libxml2</libname>
</if>
<if cond="FORMAT=='mingw'">
<libname>xml2</libname>
</if>
<!-- the list of source files to compile -->
<sources>
$(XMLBASEDIR)$(DIRSEP)c14n.c
$(XMLBASEDIR)$(DIRSEP)catalog.c
$(XMLBASEDIR)$(DIRSEP)chvalid.c
$(XMLBASEDIR)$(DIRSEP)debugXML.c
$(XMLBASEDIR)$(DIRSEP)dict.c
$(XMLBASEDIR)$(DIRSEP)DOCBparser.c
$(XMLBASEDIR)$(DIRSEP)encoding.c
$(XMLBASEDIR)$(DIRSEP)entities.c
$(XMLBASEDIR)$(DIRSEP)error.c
$(XMLBASEDIR)$(DIRSEP)globals.c
$(XMLBASEDIR)$(DIRSEP)hash.c
$(XMLBASEDIR)$(DIRSEP)HTMLparser.c
$(XMLBASEDIR)$(DIRSEP)HTMLtree.c
$(XMLBASEDIR)$(DIRSEP)legacy.c
$(XMLBASEDIR)$(DIRSEP)list.c
$(XMLBASEDIR)$(DIRSEP)nanoftp.c
$(XMLBASEDIR)$(DIRSEP)nanohttp.c
$(XMLBASEDIR)$(DIRSEP)parser.c
$(XMLBASEDIR)$(DIRSEP)parserInternals.c
$(XMLBASEDIR)$(DIRSEP)pattern.c
$(XMLBASEDIR)$(DIRSEP)relaxng.c
$(XMLBASEDIR)$(DIRSEP)SAX2.c
$(XMLBASEDIR)$(DIRSEP)SAX.c
$(XMLBASEDIR)$(DIRSEP)threads.c
$(XMLBASEDIR)$(DIRSEP)tree.c
$(XMLBASEDIR)$(DIRSEP)uri.c
$(XMLBASEDIR)$(DIRSEP)valid.c
$(XMLBASEDIR)$(DIRSEP)xinclude.c
$(XMLBASEDIR)$(DIRSEP)xlink.c
$(XMLBASEDIR)$(DIRSEP)xmlIO.c
$(XMLBASEDIR)$(DIRSEP)xmlmemory.c
$(XMLBASEDIR)$(DIRSEP)xmlreader.c
$(XMLBASEDIR)$(DIRSEP)xmlregexp.c
$(XMLBASEDIR)$(DIRSEP)xmlsave.c
$(XMLBASEDIR)$(DIRSEP)xmlschemas.c
$(XMLBASEDIR)$(DIRSEP)xmlschemastypes.c
$(XMLBASEDIR)$(DIRSEP)xmlunicode.c
$(XMLBASEDIR)$(DIRSEP)xmlwriter.c
$(XMLBASEDIR)$(DIRSEP)xpath.c
$(XMLBASEDIR)$(DIRSEP)xpointer.c
$(XMLBASEDIR)$(DIRSEP)xmlstring.c
</sources>
<!-- the list of header files (for IDE projects) -->
<headers>
$(XMLINCLUDEDIR)c14n.h
$(XMLINCLUDEDIR)catalog.h
$(XMLINCLUDEDIR)chvalid.h
$(XMLINCLUDEDIR)debugXML.h
$(XMLINCLUDEDIR)dict.h
$(XMLINCLUDEDIR)DOCBparser.h
$(XMLINCLUDEDIR)encoding.h
$(XMLINCLUDEDIR)entities.h
$(XMLINCLUDEDIR)globals.h
$(XMLINCLUDEDIR)hash.h
$(XMLINCLUDEDIR)HTMLparser.h
$(XMLINCLUDEDIR)HTMLtree.h
$(XMLINCLUDEDIR)list.h
$(XMLINCLUDEDIR)nanoftp.h
$(XMLINCLUDEDIR)nanohttp.h
$(XMLINCLUDEDIR)parser.h
$(XMLINCLUDEDIR)parserInternals.h
$(XMLINCLUDEDIR)pattern.h
$(XMLINCLUDEDIR)relaxng.h
$(XMLINCLUDEDIR)SAX.h
$(XMLINCLUDEDIR)SAX2.h
$(XMLINCLUDEDIR)schemasInternals.h
$(XMLINCLUDEDIR)threads.h
$(XMLINCLUDEDIR)tree.h
$(XMLINCLUDEDIR)uri.h
$(XMLINCLUDEDIR)valid.h
$(XMLINCLUDEDIR)xinclude.h
$(XMLINCLUDEDIR)xlink.h
$(XMLINCLUDEDIR)xmlautomata.h
$(XMLINCLUDEDIR)xmlerror.h
$(XMLINCLUDEDIR)xmlexports.h
$(XMLINCLUDEDIR)xmlIO.h
$(XMLINCLUDEDIR)xmlmemory.h
$(XMLINCLUDEDIR)xmlmodule.h
$(XMLINCLUDEDIR)xmlreader.h
$(XMLINCLUDEDIR)xmlregexp.h
$(XMLINCLUDEDIR)xmlsave.h
$(XMLINCLUDEDIR)xmlschemas.h
$(XMLINCLUDEDIR)xmlschemastypes.h
$(XMLINCLUDEDIR)xmlstring.h
$(XMLINCLUDEDIR)xmlunicode.h
$(XMLINCLUDEDIR)xmlversion.h
$(XMLINCLUDEDIR)xmlwriter.h
$(XMLINCLUDEDIR)xpath.h
$(XMLINCLUDEDIR)xpathInternals.h
$(XMLINCLUDEDIR)xpointer.h
</headers>
<!-- these ones are not inside the include/libxml folder -->
<headers>
$(XMLBASEDIR)$(DIRSEP)libxml.h
$(XMLBASEDIR)$(DIRSEP)triodef.h
$(XMLBASEDIR)$(DIRSEP)trionan.h
$(XMLBASEDIR)$(DIRSEP)include$(DIRSEP)wsockcompat.h
</headers>
</lib>
<!-- -->
<!-- LIBXML2 test programs -->
<!-- -->
<set var="BUILD_ALL_TESTS">
<!-- when using full options support with MSVC6PRJ we should
avoid to create all the DSP files required for the test
programs: they would take a _lot_ of space !! -->
<if cond="FORMAT=='msvc6prj' and FULL_OPTIONS_SUPPORT=='1'">0</if>
<!-- when creating a makefile or using MSVC6PRJ with limited
options support, then we can build all the tests safely -->
<if cond="FORMAT!='msvc6prj' or FULL_OPTIONS_SUPPORT=='0'">1</if>
</set>
<if cond="BUILD_ALL_TESTS=='1'">
<exe id="testAutomata" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testAutomata.c</sources></exe>
<exe id="testC14N" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testC14N.c</sources></exe>
<exe id="testHTML" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testHTML.c</sources></exe>
<exe id="testReader" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testReader.c</sources></exe>
<exe id="testRegexp" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testRegexp.c</sources></exe>
<exe id="testRelax" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testRelax.c</sources></exe>
<exe id="testSax" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testSax.c</sources></exe>
<exe id="testSchemas" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testSchemas.c</sources></exe>
<exe id="testURI" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testURI.c</sources></exe>
<exe id="testXPath" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testXPath.c</sources></exe>
<exe id="xmllint" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)xmllint.c</sources></exe>
<if cond="FORMAT=='autoconf'">
<exe id="testdso" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testdso.c</sources></exe>
</if>
<!-- FIXME:
<exe id="testModule" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testModule.c</sources></exe>
<if cond="WITH_THREADS=='posix'">
<exe id="testThreads" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testThreads.c</sources></exe>
</if>
<if cond="WITH_THREADS=='ctls' or WITH_THREADS=='native'">
<exe id="testThreadsWin32" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testThreadsWin32.c</sources></exe>
</if>
-->
</if>
</makefile>

1927
reactos/lib/libxml2/c14n.c Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,394 @@
#!/usr/bin/python
import sys
import time
import os
import string
import StringIO
sys.path.insert(0, "python")
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
debug = 0
verbose = 0
quiet = 1
#
# the testsuite description
#
CONF="test/relaxng/OASIS/spectest.xml"
LOG="check-relaxng-test-suite.log"
RES="relaxng-test-results.xml"
log = open(LOG, "w")
nb_schemas_tests = 0
nb_schemas_success = 0
nb_schemas_failed = 0
nb_instances_tests = 0
nb_instances_success = 0
nb_instances_failed = 0
libxml2.lineNumbersDefault(1)
#
# Error and warnng callbacks
#
def callback(ctx, str):
global log
log.write("%s%s" % (ctx, str))
libxml2.registerErrorHandler(callback, "")
#
# Resolver callback
#
resources = {}
def resolver(URL, ID, ctxt):
global resources
if string.find(URL, '#') != -1:
URL = URL[0:string.find(URL, '#')]
if resources.has_key(URL):
return(StringIO.StringIO(resources[URL]))
log.write("Resolver failure: asked %s\n" % (URL))
log.write("resources: %s\n" % (resources))
return None
#
# Load the previous results
#
#results = {}
#previous = {}
#
#try:
# res = libxml2.parseFile(RES)
#except:
# log.write("Could not parse %s" % (RES))
#
# handle a valid instance
#
def handle_valid(node, schema):
global log
global nb_instances_success
global nb_instances_failed
instance = ""
child = node.children
while child != None:
if child.type != 'text':
instance = instance + child.serialize()
child = child.next
try:
doc = libxml2.parseDoc(instance)
except:
doc = None
if doc == None:
log.write("\nFailed to parse correct instance:\n-----\n")
log.write(instance)
log.write("\n-----\n")
nb_instances_failed = nb_instances_failed + 1
return
try:
ctxt = schema.relaxNGNewValidCtxt()
ret = doc.relaxNGValidateDoc(ctxt)
except:
ret = -1
if ret != 0:
log.write("\nFailed to validate correct instance:\n-----\n")
log.write(instance)
log.write("\n-----\n")
nb_instances_failed = nb_instances_failed + 1
else:
nb_instances_success = nb_instances_success + 1
doc.freeDoc()
#
# handle an invalid instance
#
def handle_invalid(node, schema):
global log
global nb_instances_success
global nb_instances_failed
instance = ""
child = node.children
while child != None:
if child.type != 'text':
instance = instance + child.serialize()
child = child.next
try:
doc = libxml2.parseDoc(instance)
except:
doc = None
if doc == None:
log.write("\nStrange: failed to parse incorrect instance:\n-----\n")
log.write(instance)
log.write("\n-----\n")
return
try:
ctxt = schema.relaxNGNewValidCtxt()
ret = doc.relaxNGValidateDoc(ctxt)
except:
ret = -1
if ret == 0:
log.write("\nFailed to detect validation problem in instance:\n-----\n")
log.write(instance)
log.write("\n-----\n")
nb_instances_failed = nb_instances_failed + 1
else:
nb_instances_success = nb_instances_success + 1
doc.freeDoc()
#
# handle an incorrect test
#
def handle_correct(node):
global log
global nb_schemas_success
global nb_schemas_failed
schema = ""
child = node.children
while child != None:
if child.type != 'text':
schema = schema + child.serialize()
child = child.next
try:
rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
rngs = rngp.relaxNGParse()
except:
rngs = None
if rngs == None:
log.write("\nFailed to compile correct schema:\n-----\n")
log.write(schema)
log.write("\n-----\n")
nb_schemas_failed = nb_schemas_failed + 1
else:
nb_schemas_success = nb_schemas_success + 1
return rngs
def handle_incorrect(node):
global log
global nb_schemas_success
global nb_schemas_failed
schema = ""
child = node.children
while child != None:
if child.type != 'text':
schema = schema + child.serialize()
child = child.next
try:
rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
rngs = rngp.relaxNGParse()
except:
rngs = None
if rngs != None:
log.write("\nFailed to detect schema error in:\n-----\n")
log.write(schema)
log.write("\n-----\n")
nb_schemas_failed = nb_schemas_failed + 1
else:
# log.write("\nSuccess detecting schema error in:\n-----\n")
# log.write(schema)
# log.write("\n-----\n")
nb_schemas_success = nb_schemas_success + 1
return None
#
# resource handling: keep a dictionary of URL->string mappings
#
def handle_resource(node, dir):
global resources
try:
name = node.prop('name')
except:
name = None
if name == None or name == '':
log.write("resource has no name")
return;
if dir != None:
# name = libxml2.buildURI(name, dir)
name = dir + '/' + name
res = ""
child = node.children
while child != None:
if child.type != 'text':
res = res + child.serialize()
child = child.next
resources[name] = res
#
# dir handling: pseudo directory resources
#
def handle_dir(node, dir):
try:
name = node.prop('name')
except:
name = None
if name == None or name == '':
log.write("resource has no name")
return;
if dir != None:
# name = libxml2.buildURI(name, dir)
name = dir + '/' + name
dirs = node.xpathEval('dir')
for dir in dirs:
handle_dir(dir, name)
res = node.xpathEval('resource')
for r in res:
handle_resource(r, name)
#
# handle a testCase element
#
def handle_testCase(node):
global nb_schemas_tests
global nb_instances_tests
global resources
sections = node.xpathEval('string(section)')
log.write("\n ======== test %d line %d section %s ==========\n" % (
nb_schemas_tests, node.lineNo(), sections))
resources = {}
if debug:
print "test %d line %d" % (nb_schemas_tests, node.lineNo())
dirs = node.xpathEval('dir')
for dir in dirs:
handle_dir(dir, None)
res = node.xpathEval('resource')
for r in res:
handle_resource(r, None)
tsts = node.xpathEval('incorrect')
if tsts != []:
if len(tsts) != 1:
print "warning test line %d has more than one <incorrect> example" %(node.lineNo())
schema = handle_incorrect(tsts[0])
else:
tsts = node.xpathEval('correct')
if tsts != []:
if len(tsts) != 1:
print "warning test line %d has more than one <correct> example"% (node.lineNo())
schema = handle_correct(tsts[0])
else:
print "warning <testCase> line %d has no <correct> nor <incorrect> child" % (node.lineNo())
nb_schemas_tests = nb_schemas_tests + 1;
valids = node.xpathEval('valid')
invalids = node.xpathEval('invalid')
nb_instances_tests = nb_instances_tests + len(valids) + len(invalids)
if schema != None:
for valid in valids:
handle_valid(valid, schema)
for invalid in invalids:
handle_invalid(invalid, schema)
#
# handle a testSuite element
#
def handle_testSuite(node, level = 0):
global nb_schemas_tests, nb_schemas_success, nb_schemas_failed
global nb_instances_tests, nb_instances_success, nb_instances_failed
global quiet
if level >= 1:
old_schemas_tests = nb_schemas_tests
old_schemas_success = nb_schemas_success
old_schemas_failed = nb_schemas_failed
old_instances_tests = nb_instances_tests
old_instances_success = nb_instances_success
old_instances_failed = nb_instances_failed
docs = node.xpathEval('documentation')
authors = node.xpathEval('author')
if docs != []:
msg = ""
for doc in docs:
msg = msg + doc.content + " "
if authors != []:
msg = msg + "written by "
for author in authors:
msg = msg + author.content + " "
if quiet == 0:
print msg
sections = node.xpathEval('section')
if sections != [] and level <= 0:
msg = ""
for section in sections:
msg = msg + section.content + " "
if quiet == 0:
print "Tests for section %s" % (msg)
for test in node.xpathEval('testCase'):
handle_testCase(test)
for test in node.xpathEval('testSuite'):
handle_testSuite(test, level + 1)
if verbose and level >= 1 and sections != []:
msg = ""
for section in sections:
msg = msg + section.content + " "
print "Result of tests for section %s" % (msg)
if nb_schemas_tests != old_schemas_tests:
print "found %d test schemas: %d success %d failures" % (
nb_schemas_tests - old_schemas_tests,
nb_schemas_success - old_schemas_success,
nb_schemas_failed - old_schemas_failed)
if nb_instances_tests != old_instances_tests:
print "found %d test instances: %d success %d failures" % (
nb_instances_tests - old_instances_tests,
nb_instances_success - old_instances_success,
nb_instances_failed - old_instances_failed)
#
# Parse the conf file
#
libxml2.substituteEntitiesDefault(1);
testsuite = libxml2.parseFile(CONF)
libxml2.setEntityLoader(resolver)
root = testsuite.getRootElement()
if root.name != 'testSuite':
print "%s doesn't start with a testSuite element, aborting" % (CONF)
sys.exit(1)
if quiet == 0:
print "Running Relax NG testsuite"
handle_testSuite(root)
if quiet == 0:
print "\nTOTAL:\n"
if quiet == 0 or nb_schemas_failed != 0:
print "found %d test schemas: %d success %d failures" % (
nb_schemas_tests, nb_schemas_success, nb_schemas_failed)
if quiet == 0 or nb_instances_failed != 0:
print "found %d test instances: %d success %d failures" % (
nb_instances_tests, nb_instances_success, nb_instances_failed)
testsuite.freeDoc()
# Memory debug specific
libxml2.relaxNGCleanupTypes()
libxml2.cleanupParser()
if libxml2.debugMemory(1) == 0:
if quiet == 0:
print "OK"
else:
print "Memory leak %d bytes" % (libxml2.debugMemory(1))
libxml2.dumpMemory()

View file

@ -0,0 +1,418 @@
#!/usr/bin/python
import sys
import time
import os
import string
import StringIO
sys.path.insert(0, "python")
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
debug = 0
quiet = 1
#
# the testsuite description
#
CONF="test/relaxng/testsuite.xml"
LOG="check-relaxng-test-suite2.log"
log = open(LOG, "w")
nb_schemas_tests = 0
nb_schemas_success = 0
nb_schemas_failed = 0
nb_instances_tests = 0
nb_instances_success = 0
nb_instances_failed = 0
libxml2.lineNumbersDefault(1)
#
# Resolver callback
#
resources = {}
def resolver(URL, ID, ctxt):
global resources
if resources.has_key(URL):
return(StringIO.StringIO(resources[URL]))
log.write("Resolver failure: asked %s\n" % (URL))
log.write("resources: %s\n" % (resources))
return None
#
# Load the previous results
#
#results = {}
#previous = {}
#
#try:
# res = libxml2.parseFile(RES)
#except:
# log.write("Could not parse %s" % (RES))
#
# handle a valid instance
#
def handle_valid(node, schema):
global log
global nb_instances_success
global nb_instances_failed
instance = node.prop("dtd")
if instance == None:
instance = ""
child = node.children
while child != None:
if child.type != 'text':
instance = instance + child.serialize()
child = child.next
# mem = libxml2.debugMemory(1);
try:
doc = libxml2.parseDoc(instance)
except:
doc = None
if doc == None:
log.write("\nFailed to parse correct instance:\n-----\n")
log.write(instance)
log.write("\n-----\n")
nb_instances_failed = nb_instances_failed + 1
return
if debug:
print "instance line %d" % (node.lineNo())
try:
ctxt = schema.relaxNGNewValidCtxt()
ret = doc.relaxNGValidateDoc(ctxt)
del ctxt
except:
ret = -1
doc.freeDoc()
# if mem != libxml2.debugMemory(1):
# print "validating instance %d line %d leaks" % (
# nb_instances_tests, node.lineNo())
if ret != 0:
log.write("\nFailed to validate correct instance:\n-----\n")
log.write(instance)
log.write("\n-----\n")
nb_instances_failed = nb_instances_failed + 1
else:
nb_instances_success = nb_instances_success + 1
#
# handle an invalid instance
#
def handle_invalid(node, schema):
global log
global nb_instances_success
global nb_instances_failed
instance = node.prop("dtd")
if instance == None:
instance = ""
child = node.children
while child != None:
if child.type != 'text':
instance = instance + child.serialize()
child = child.next
# mem = libxml2.debugMemory(1);
try:
doc = libxml2.parseDoc(instance)
except:
doc = None
if doc == None:
log.write("\nStrange: failed to parse incorrect instance:\n-----\n")
log.write(instance)
log.write("\n-----\n")
return
if debug:
print "instance line %d" % (node.lineNo())
try:
ctxt = schema.relaxNGNewValidCtxt()
ret = doc.relaxNGValidateDoc(ctxt)
del ctxt
except:
ret = -1
doc.freeDoc()
# mem2 = libxml2.debugMemory(1)
# if mem != mem2:
# print "validating instance %d line %d leaks %d bytes" % (
# nb_instances_tests, node.lineNo(), mem2 - mem)
if ret == 0:
log.write("\nFailed to detect validation problem in instance:\n-----\n")
log.write(instance)
log.write("\n-----\n")
nb_instances_failed = nb_instances_failed + 1
else:
nb_instances_success = nb_instances_success + 1
#
# handle an incorrect test
#
def handle_correct(node):
global log
global nb_schemas_success
global nb_schemas_failed
schema = ""
child = node.children
while child != None:
if child.type != 'text':
schema = schema + child.serialize()
child = child.next
try:
rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
rngs = rngp.relaxNGParse()
except:
rngs = None
if rngs == None:
log.write("\nFailed to compile correct schema:\n-----\n")
log.write(schema)
log.write("\n-----\n")
nb_schemas_failed = nb_schemas_failed + 1
else:
nb_schemas_success = nb_schemas_success + 1
return rngs
def handle_incorrect(node):
global log
global nb_schemas_success
global nb_schemas_failed
schema = ""
child = node.children
while child != None:
if child.type != 'text':
schema = schema + child.serialize()
child = child.next
try:
rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
rngs = rngp.relaxNGParse()
except:
rngs = None
if rngs != None:
log.write("\nFailed to detect schema error in:\n-----\n")
log.write(schema)
log.write("\n-----\n")
nb_schemas_failed = nb_schemas_failed + 1
else:
# log.write("\nSuccess detecting schema error in:\n-----\n")
# log.write(schema)
# log.write("\n-----\n")
nb_schemas_success = nb_schemas_success + 1
return None
#
# resource handling: keep a dictionary of URL->string mappings
#
def handle_resource(node, dir):
global resources
try:
name = node.prop('name')
except:
name = None
if name == None or name == '':
log.write("resource has no name")
return;
if dir != None:
# name = libxml2.buildURI(name, dir)
name = dir + '/' + name
res = ""
child = node.children
while child != None:
if child.type != 'text':
res = res + child.serialize()
child = child.next
resources[name] = res
#
# dir handling: pseudo directory resources
#
def handle_dir(node, dir):
try:
name = node.prop('name')
except:
name = None
if name == None or name == '':
log.write("resource has no name")
return;
if dir != None:
# name = libxml2.buildURI(name, dir)
name = dir + '/' + name
dirs = node.xpathEval('dir')
for dir in dirs:
handle_dir(dir, name)
res = node.xpathEval('resource')
for r in res:
handle_resource(r, name)
#
# handle a testCase element
#
def handle_testCase(node):
global nb_schemas_tests
global nb_instances_tests
global resources
sections = node.xpathEval('string(section)')
log.write("\n ======== test %d line %d section %s ==========\n" % (
nb_schemas_tests, node.lineNo(), sections))
resources = {}
if debug:
print "test %d line %d" % (nb_schemas_tests, node.lineNo())
dirs = node.xpathEval('dir')
for dir in dirs:
handle_dir(dir, None)
res = node.xpathEval('resource')
for r in res:
handle_resource(r, None)
tsts = node.xpathEval('incorrect')
if tsts != []:
if len(tsts) != 1:
print "warning test line %d has more than one <incorrect> example" %(node.lineNo())
schema = handle_incorrect(tsts[0])
else:
tsts = node.xpathEval('correct')
if tsts != []:
if len(tsts) != 1:
print "warning test line %d has more than one <correct> example"% (node.lineNo())
schema = handle_correct(tsts[0])
else:
print "warning <testCase> line %d has no <correct> nor <incorrect> child" % (node.lineNo())
nb_schemas_tests = nb_schemas_tests + 1;
valids = node.xpathEval('valid')
invalids = node.xpathEval('invalid')
nb_instances_tests = nb_instances_tests + len(valids) + len(invalids)
if schema != None:
for valid in valids:
handle_valid(valid, schema)
for invalid in invalids:
handle_invalid(invalid, schema)
#
# handle a testSuite element
#
def handle_testSuite(node, level = 0):
global nb_schemas_tests, nb_schemas_success, nb_schemas_failed
global nb_instances_tests, nb_instances_success, nb_instances_failed
if level >= 1:
old_schemas_tests = nb_schemas_tests
old_schemas_success = nb_schemas_success
old_schemas_failed = nb_schemas_failed
old_instances_tests = nb_instances_tests
old_instances_success = nb_instances_success
old_instances_failed = nb_instances_failed
docs = node.xpathEval('documentation')
authors = node.xpathEval('author')
if docs != []:
msg = ""
for doc in docs:
msg = msg + doc.content + " "
if authors != []:
msg = msg + "written by "
for author in authors:
msg = msg + author.content + " "
if quiet == 0:
print msg
sections = node.xpathEval('section')
if sections != [] and level <= 0:
msg = ""
for section in sections:
msg = msg + section.content + " "
if quiet == 0:
print "Tests for section %s" % (msg)
for test in node.xpathEval('testCase'):
handle_testCase(test)
for test in node.xpathEval('testSuite'):
handle_testSuite(test, level + 1)
if level >= 1 and sections != []:
msg = ""
for section in sections:
msg = msg + section.content + " "
print "Result of tests for section %s" % (msg)
if nb_schemas_tests != old_schemas_tests:
print "found %d test schemas: %d success %d failures" % (
nb_schemas_tests - old_schemas_tests,
nb_schemas_success - old_schemas_success,
nb_schemas_failed - old_schemas_failed)
if nb_instances_tests != old_instances_tests:
print "found %d test instances: %d success %d failures" % (
nb_instances_tests - old_instances_tests,
nb_instances_success - old_instances_success,
nb_instances_failed - old_instances_failed)
#
# Parse the conf file
#
libxml2.substituteEntitiesDefault(1);
testsuite = libxml2.parseFile(CONF)
#
# Error and warnng callbacks
#
def callback(ctx, str):
global log
log.write("%s%s" % (ctx, str))
libxml2.registerErrorHandler(callback, "")
libxml2.setEntityLoader(resolver)
root = testsuite.getRootElement()
if root.name != 'testSuite':
print "%s doesn't start with a testSuite element, aborting" % (CONF)
sys.exit(1)
if quiet == 0:
print "Running Relax NG testsuite"
handle_testSuite(root)
if quiet == 0:
print "\nTOTAL:\n"
if quiet == 0 or nb_schemas_failed != 0:
print "found %d test schemas: %d success %d failures" % (
nb_schemas_tests, nb_schemas_success, nb_schemas_failed)
if quiet == 0 or nb_instances_failed != 0:
print "found %d test instances: %d success %d failures" % (
nb_instances_tests, nb_instances_success, nb_instances_failed)
testsuite.freeDoc()
# Memory debug specific
libxml2.relaxNGCleanupTypes()
libxml2.cleanupParser()
if libxml2.debugMemory(1) == 0:
if quiet == 0:
print "OK"
else:
print "Memory leak %d bytes" % (libxml2.debugMemory(1))
libxml2.dumpMemory()

View file

@ -0,0 +1,221 @@
#!/usr/bin/python
import sys
import time
import os
import string
sys.path.insert(0, "python")
import libxml2
#
# the testsuite description
#
DIR="xinclude-test-suite"
CONF="testdescr.xml"
LOG="check-xinclude-test-suite.log"
log = open(LOG, "w")
os.chdir(DIR)
test_nr = 0
test_succeed = 0
test_failed = 0
test_error = 0
#
# Error and warning handlers
#
error_nr = 0
error_msg = ''
def errorHandler(ctx, str):
global error_nr
global error_msg
if string.find(str, "error:") >= 0:
error_nr = error_nr + 1
if len(error_msg) < 300:
if len(error_msg) == 0 or error_msg[-1] == '\n':
error_msg = error_msg + " >>" + str
else:
error_msg = error_msg + str
libxml2.registerErrorHandler(errorHandler, None)
def testXInclude(filename, id):
global error_nr
global error_msg
global log
error_nr = 0
error_msg = ''
print "testXInclude(%s, %s)" % (filename, id)
return 1
def runTest(test, basedir):
global test_nr
global test_failed
global test_error
global test_succeed
global error_msg
global log
fatal_error = 0
uri = test.prop('href')
id = test.prop('id')
type = test.prop('type')
if uri == None:
print "Test without ID:", uri
return -1
if id == None:
print "Test without URI:", id
return -1
if type == None:
print "Test without URI:", id
return -1
if basedir != None:
URI = basedir + "/" + uri
else:
URI = uri
if os.access(URI, os.R_OK) == 0:
print "Test %s missing: base %s uri %s" % (URI, basedir, uri)
return -1
expected = None
outputfile = None
diff = None
if type != 'error':
output = test.xpathEval('string(output)')
if output == 'No output file.':
output = None
if output == '':
output = None
if output != None:
if basedir != None:
output = basedir + "/" + output
if os.access(output, os.R_OK) == 0:
print "Result for %s missing: %s" % (id, output)
output = None
else:
try:
f = open(output)
expected = f.read()
outputfile = output
except:
print "Result for %s unreadable: %s" % (id, output)
try:
# print "testing %s" % (URI)
doc = libxml2.parseFile(URI)
except:
doc = None
if doc != None:
res = doc.xincludeProcess()
if res >= 0 and expected != None:
result = doc.serialize()
if result != expected:
print "Result for %s differs" % (id)
open("xinclude.res", "w").write(result)
diff = os.popen("diff %s xinclude.res" % outputfile).read()
doc.freeDoc()
else:
print "Failed to parse %s" % (URI)
res = -1
test_nr = test_nr + 1
if type == 'success':
if res > 0:
test_succeed = test_succeed + 1
elif res == 0:
test_failed = test_failed + 1
print "Test %s: no substitution done ???" % (id)
elif res < 0:
test_error = test_error + 1
print "Test %s: failed valid XInclude processing" % (id)
elif type == 'error':
if res > 0:
test_error = test_error + 1
print "Test %s: failed to detect invalid XInclude processing" % (id)
elif res == 0:
test_failed = test_failed + 1
print "Test %s: Invalid but no substitution done" % (id)
elif res < 0:
test_succeed = test_succeed + 1
elif type == 'optional':
if res > 0:
test_succeed = test_succeed + 1
else:
print "Test %s: failed optional test" % (id)
# Log the ontext
if res != 1:
log.write("Test ID %s\n" % (id))
log.write(" File: %s\n" % (URI))
content = string.strip(test.content)
while content[-1] == '\n':
content = content[0:-1]
log.write(" %s:%s\n\n" % (type, content))
if error_msg != '':
log.write(" ----\n%s ----\n" % (error_msg))
error_msg = ''
log.write("\n")
if diff != None:
log.write("diff from test %s:\n" %(id))
log.write(" -----------\n%s\n -----------\n" % (diff));
return 0
def runTestCases(case):
creator = case.prop('creator')
if creator != None:
print "=>", creator
base = case.getBase(None)
basedir = case.prop('basedir')
if basedir != None:
base = libxml2.buildURI(basedir, base)
test = case.children
while test != None:
if test.name == 'testcase':
runTest(test, base)
if test.name == 'testcases':
runTestCases(test)
test = test.next
conf = libxml2.parseFile(CONF)
if conf == None:
print "Unable to load %s" % CONF
sys.exit(1)
testsuite = conf.getRootElement()
if testsuite.name != 'testsuite':
print "Expecting TESTSUITE root element: aborting"
sys.exit(1)
profile = testsuite.prop('PROFILE')
if profile != None:
print profile
start = time.time()
case = testsuite.children
while case != None:
if case.name == 'testcases':
old_test_nr = test_nr
old_test_succeed = test_succeed
old_test_failed = test_failed
old_test_error = test_error
runTestCases(case)
print " Ran %d tests: %d suceeded, %d failed and %d generated an error" % (
test_nr - old_test_nr, test_succeed - old_test_succeed,
test_failed - old_test_failed, test_error - old_test_error)
case = case.next
conf.freeDoc()
log.close()
print "Ran %d tests: %d suceeded, %d failed and %d generated an error in %.2f s." % (
test_nr, test_succeed, test_failed, test_error, time.time() - start)

View file

@ -0,0 +1,409 @@
#!/usr/bin/python
import sys
import time
import os
import string
sys.path.insert(0, "python")
import libxml2
test_nr = 0
test_succeed = 0
test_failed = 0
test_error = 0
#
# the testsuite description
#
CONF="xml-test-suite/xmlconf/xmlconf.xml"
LOG="check-xml-test-suite.log"
log = open(LOG, "w")
#
# Error and warning handlers
#
error_nr = 0
error_msg = ''
def errorHandler(ctx, str):
global error_nr
global error_msg
error_nr = error_nr + 1
if len(error_msg) < 300:
if len(error_msg) == 0 or error_msg[-1] == '\n':
error_msg = error_msg + " >>" + str
else:
error_msg = error_msg + str
libxml2.registerErrorHandler(errorHandler, None)
#warning_nr = 0
#warning = ''
#def warningHandler(ctx, str):
# global warning_nr
# global warning
#
# warning_nr = warning_nr + 1
# warning = warning + str
#
#libxml2.registerWarningHandler(warningHandler, None)
#
# Used to load the XML testsuite description
#
def loadNoentDoc(filename):
ctxt = libxml2.createFileParserCtxt(filename)
if ctxt == None:
return None
ctxt.replaceEntities(1)
ctxt.parseDocument()
try:
doc = ctxt.doc()
except:
doc = None
if ctxt.wellFormed() != 1:
doc.freeDoc()
return None
return doc
#
# The conformance testing routines
#
def testNotWf(filename, id):
global error_nr
global error_msg
global log
error_nr = 0
error_msg = ''
ctxt = libxml2.createFileParserCtxt(filename)
if ctxt == None:
return -1
ret = ctxt.parseDocument()
try:
doc = ctxt.doc()
except:
doc = None
if doc != None:
doc.freeDoc()
if ret == 0 or ctxt.wellFormed() != 0:
print "%s: error: Well Formedness error not detected" % (id)
log.write("%s: error: Well Formedness error not detected\n" % (id))
return 0
return 1
def testNotWfEnt(filename, id):
global error_nr
global error_msg
global log
error_nr = 0
error_msg = ''
ctxt = libxml2.createFileParserCtxt(filename)
if ctxt == None:
return -1
ctxt.replaceEntities(1)
ret = ctxt.parseDocument()
try:
doc = ctxt.doc()
except:
doc = None
if doc != None:
doc.freeDoc()
if ret == 0 or ctxt.wellFormed() != 0:
print "%s: error: Well Formedness error not detected" % (id)
log.write("%s: error: Well Formedness error not detected\n" % (id))
return 0
return 1
def testNotWfEntDtd(filename, id):
global error_nr
global error_msg
global log
error_nr = 0
error_msg = ''
ctxt = libxml2.createFileParserCtxt(filename)
if ctxt == None:
return -1
ctxt.replaceEntities(1)
ctxt.loadSubset(1)
ret = ctxt.parseDocument()
try:
doc = ctxt.doc()
except:
doc = None
if doc != None:
doc.freeDoc()
if ret == 0 or ctxt.wellFormed() != 0:
print "%s: error: Well Formedness error not detected" % (id)
log.write("%s: error: Well Formedness error not detected\n" % (id))
return 0
return 1
def testWfEntDtd(filename, id):
global error_nr
global error_msg
global log
error_nr = 0
error_msg = ''
ctxt = libxml2.createFileParserCtxt(filename)
if ctxt == None:
return -1
ctxt.replaceEntities(1)
ctxt.loadSubset(1)
ret = ctxt.parseDocument()
try:
doc = ctxt.doc()
except:
doc = None
if doc == None or ret != 0 or ctxt.wellFormed() == 0:
print "%s: error: wrongly failed to parse the document" % (id)
log.write("%s: error: wrongly failed to parse the document\n" % (id))
if doc != None:
doc.freeDoc()
return 0
if error_nr != 0:
print "%s: warning: WF document generated an error msg" % (id)
log.write("%s: error: WF document generated an error msg\n" % (id))
doc.freeDoc()
return 2
doc.freeDoc()
return 1
def testError(filename, id):
global error_nr
global error_msg
global log
error_nr = 0
error_msg = ''
ctxt = libxml2.createFileParserCtxt(filename)
if ctxt == None:
return -1
ctxt.replaceEntities(1)
ctxt.loadSubset(1)
ret = ctxt.parseDocument()
try:
doc = ctxt.doc()
except:
doc = None
if doc != None:
doc.freeDoc()
if ctxt.wellFormed() == 0:
print "%s: warning: failed to parse the document but accepted" % (id)
log.write("%s: warning: failed to parse the document but accepte\n" % (id))
return 2
if error_nr != 0:
print "%s: warning: WF document generated an error msg" % (id)
log.write("%s: error: WF document generated an error msg\n" % (id))
return 2
return 1
def testInvalid(filename, id):
global error_nr
global error_msg
global log
error_nr = 0
error_msg = ''
ctxt = libxml2.createFileParserCtxt(filename)
if ctxt == None:
return -1
ctxt.validate(1)
ret = ctxt.parseDocument()
try:
doc = ctxt.doc()
except:
doc = None
valid = ctxt.isValid()
if doc == None:
print "%s: error: wrongly failed to parse the document" % (id)
log.write("%s: error: wrongly failed to parse the document\n" % (id))
return 0
if valid == 1:
print "%s: error: Validity error not detected" % (id)
log.write("%s: error: Validity error not detected\n" % (id))
doc.freeDoc()
return 0
if error_nr == 0:
print "%s: warning: Validity error not reported" % (id)
log.write("%s: warning: Validity error not reported\n" % (id))
doc.freeDoc()
return 2
doc.freeDoc()
return 1
def testValid(filename, id):
global error_nr
global error_msg
error_nr = 0
error_msg = ''
ctxt = libxml2.createFileParserCtxt(filename)
if ctxt == None:
return -1
ctxt.validate(1)
ctxt.parseDocument()
try:
doc = ctxt.doc()
except:
doc = None
valid = ctxt.isValid()
if doc == None:
print "%s: error: wrongly failed to parse the document" % (id)
log.write("%s: error: wrongly failed to parse the document\n" % (id))
return 0
if valid != 1:
print "%s: error: Validity check failed" % (id)
log.write("%s: error: Validity check failed\n" % (id))
doc.freeDoc()
return 0
if error_nr != 0 or valid != 1:
print "%s: warning: valid document reported an error" % (id)
log.write("%s: warning: valid document reported an error\n" % (id))
doc.freeDoc()
return 2
doc.freeDoc()
return 1
def runTest(test):
global test_nr
global test_succeed
global test_failed
global error_msg
global log
uri = test.prop('URI')
id = test.prop('ID')
if uri == None:
print "Test without ID:", uri
return -1
if id == None:
print "Test without URI:", id
return -1
base = test.getBase(None)
URI = libxml2.buildURI(uri, base)
if os.access(URI, os.R_OK) == 0:
print "Test %s missing: base %s uri %s" % (URI, base, uri)
return -1
type = test.prop('TYPE')
if type == None:
print "Test %s missing TYPE" % (id)
return -1
extra = None
if type == "invalid":
res = testInvalid(URI, id)
elif type == "valid":
res = testValid(URI, id)
elif type == "not-wf":
extra = test.prop('ENTITIES')
# print URI
#if extra == None:
# res = testNotWfEntDtd(URI, id)
#elif extra == 'none':
# res = testNotWf(URI, id)
#elif extra == 'general':
# res = testNotWfEnt(URI, id)
#elif extra == 'both' or extra == 'parameter':
res = testNotWfEntDtd(URI, id)
#else:
# print "Unknow value %s for an ENTITIES test value" % (extra)
# return -1
elif type == "error":
res = testError(URI, id)
else:
# TODO skipped for now
return -1
test_nr = test_nr + 1
if res > 0:
test_succeed = test_succeed + 1
elif res == 0:
test_failed = test_failed + 1
elif res < 0:
test_error = test_error + 1
# Log the ontext
if res != 1:
log.write(" File: %s\n" % (URI))
content = string.strip(test.content)
while content[-1] == '\n':
content = content[0:-1]
if extra != None:
log.write(" %s:%s:%s\n" % (type, extra, content))
else:
log.write(" %s:%s\n\n" % (type, content))
if error_msg != '':
log.write(" ----\n%s ----\n" % (error_msg))
error_msg = ''
log.write("\n")
return 0
def runTestCases(case):
profile = case.prop('PROFILE')
if profile != None and \
string.find(profile, "IBM XML Conformance Test Suite - Production") < 0:
print "=>", profile
test = case.children
while test != None:
if test.name == 'TEST':
runTest(test)
if test.name == 'TESTCASES':
runTestCases(test)
test = test.next
conf = loadNoentDoc(CONF)
if conf == None:
print "Unable to load %s" % CONF
sys.exit(1)
testsuite = conf.getRootElement()
if testsuite.name != 'TESTSUITE':
print "Expecting TESTSUITE root element: aborting"
sys.exit(1)
profile = testsuite.prop('PROFILE')
if profile != None:
print profile
start = time.time()
case = testsuite.children
while case != None:
if case.name == 'TESTCASES':
old_test_nr = test_nr
old_test_succeed = test_succeed
old_test_failed = test_failed
old_test_error = test_error
runTestCases(case)
print " Ran %d tests: %d suceeded, %d failed and %d generated an error" % (
test_nr - old_test_nr, test_succeed - old_test_succeed,
test_failed - old_test_failed, test_error - old_test_error)
case = case.next
conf.freeDoc()
log.close()
print "Ran %d tests: %d suceeded, %d failed and %d generated an error in %.2f s." % (
test_nr, test_succeed, test_failed, test_error, time.time() - start)

View file

@ -0,0 +1,420 @@
#!/usr/bin/python
import sys
import time
import os
import string
import StringIO
sys.path.insert(0, "python")
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
debug = 0
verbose = 0
quiet = 1
#
# the testsuite description
#
CONF="test/xsdtest/xsdtestsuite.xml"
LOG="check-xsddata-test-suite.log"
log = open(LOG, "w")
nb_schemas_tests = 0
nb_schemas_success = 0
nb_schemas_failed = 0
nb_instances_tests = 0
nb_instances_success = 0
nb_instances_failed = 0
libxml2.lineNumbersDefault(1)
#
# Error and warnng callbacks
#
def callback(ctx, str):
global log
log.write("%s%s" % (ctx, str))
libxml2.registerErrorHandler(callback, "")
#
# Resolver callback
#
resources = {}
def resolver(URL, ID, ctxt):
global resources
if resources.has_key(URL):
return(StringIO.StringIO(resources[URL]))
log.write("Resolver failure: asked %s\n" % (URL))
log.write("resources: %s\n" % (resources))
return None
#
# handle a valid instance
#
def handle_valid(node, schema):
global log
global nb_instances_success
global nb_instances_failed
instance = node.prop("dtd")
if instance == None:
instance = ""
child = node.children
while child != None:
if child.type != 'text':
instance = instance + child.serialize()
child = child.next
mem = libxml2.debugMemory(1);
try:
doc = libxml2.parseDoc(instance)
except:
doc = None
if doc == None:
log.write("\nFailed to parse correct instance:\n-----\n")
log.write(instance)
log.write("\n-----\n")
nb_instances_failed = nb_instances_failed + 1
return
if debug:
print "instance line %d" % (node.lineNo())
try:
ctxt = schema.relaxNGNewValidCtxt()
ret = doc.relaxNGValidateDoc(ctxt)
del ctxt
except:
ret = -1
doc.freeDoc()
if mem != libxml2.debugMemory(1):
print "validating instance %d line %d leaks" % (
nb_instances_tests, node.lineNo())
if ret != 0:
log.write("\nFailed to validate correct instance:\n-----\n")
log.write(instance)
log.write("\n-----\n")
nb_instances_failed = nb_instances_failed + 1
else:
nb_instances_success = nb_instances_success + 1
#
# handle an invalid instance
#
def handle_invalid(node, schema):
global log
global nb_instances_success
global nb_instances_failed
instance = node.prop("dtd")
if instance == None:
instance = ""
child = node.children
while child != None:
if child.type != 'text':
instance = instance + child.serialize()
child = child.next
# mem = libxml2.debugMemory(1);
try:
doc = libxml2.parseDoc(instance)
except:
doc = None
if doc == None:
log.write("\nStrange: failed to parse incorrect instance:\n-----\n")
log.write(instance)
log.write("\n-----\n")
return
if debug:
print "instance line %d" % (node.lineNo())
try:
ctxt = schema.relaxNGNewValidCtxt()
ret = doc.relaxNGValidateDoc(ctxt)
del ctxt
except:
ret = -1
doc.freeDoc()
# if mem != libxml2.debugMemory(1):
# print "validating instance %d line %d leaks" % (
# nb_instances_tests, node.lineNo())
if ret == 0:
log.write("\nFailed to detect validation problem in instance:\n-----\n")
log.write(instance)
log.write("\n-----\n")
nb_instances_failed = nb_instances_failed + 1
else:
nb_instances_success = nb_instances_success + 1
#
# handle an incorrect test
#
def handle_correct(node):
global log
global nb_schemas_success
global nb_schemas_failed
schema = ""
child = node.children
while child != None:
if child.type != 'text':
schema = schema + child.serialize()
child = child.next
try:
rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
rngs = rngp.relaxNGParse()
except:
rngs = None
if rngs == None:
log.write("\nFailed to compile correct schema:\n-----\n")
log.write(schema)
log.write("\n-----\n")
nb_schemas_failed = nb_schemas_failed + 1
else:
nb_schemas_success = nb_schemas_success + 1
return rngs
def handle_incorrect(node):
global log
global nb_schemas_success
global nb_schemas_failed
schema = ""
child = node.children
while child != None:
if child.type != 'text':
schema = schema + child.serialize()
child = child.next
try:
rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
rngs = rngp.relaxNGParse()
except:
rngs = None
if rngs != None:
log.write("\nFailed to detect schema error in:\n-----\n")
log.write(schema)
log.write("\n-----\n")
nb_schemas_failed = nb_schemas_failed + 1
else:
# log.write("\nSuccess detecting schema error in:\n-----\n")
# log.write(schema)
# log.write("\n-----\n")
nb_schemas_success = nb_schemas_success + 1
return None
#
# resource handling: keep a dictionary of URL->string mappings
#
def handle_resource(node, dir):
global resources
try:
name = node.prop('name')
except:
name = None
if name == None or name == '':
log.write("resource has no name")
return;
if dir != None:
# name = libxml2.buildURI(name, dir)
name = dir + '/' + name
res = ""
child = node.children
while child != None:
if child.type != 'text':
res = res + child.serialize()
child = child.next
resources[name] = res
#
# dir handling: pseudo directory resources
#
def handle_dir(node, dir):
try:
name = node.prop('name')
except:
name = None
if name == None or name == '':
log.write("resource has no name")
return;
if dir != None:
# name = libxml2.buildURI(name, dir)
name = dir + '/' + name
dirs = node.xpathEval('dir')
for dir in dirs:
handle_dir(dir, name)
res = node.xpathEval('resource')
for r in res:
handle_resource(r, name)
#
# handle a testCase element
#
def handle_testCase(node):
global nb_schemas_tests
global nb_instances_tests
global resources
sections = node.xpathEval('string(section)')
log.write("\n ======== test %d line %d section %s ==========\n" % (
nb_schemas_tests, node.lineNo(), sections))
resources = {}
if debug:
print "test %d line %d" % (nb_schemas_tests, node.lineNo())
dirs = node.xpathEval('dir')
for dir in dirs:
handle_dir(dir, None)
res = node.xpathEval('resource')
for r in res:
handle_resource(r, None)
tsts = node.xpathEval('incorrect')
if tsts != []:
if len(tsts) != 1:
print "warning test line %d has more than one <incorrect> example" %(node.lineNo())
schema = handle_incorrect(tsts[0])
else:
tsts = node.xpathEval('correct')
if tsts != []:
if len(tsts) != 1:
print "warning test line %d has more than one <correct> example"% (node.lineNo())
schema = handle_correct(tsts[0])
else:
print "warning <testCase> line %d has no <correct> nor <incorrect> child" % (node.lineNo())
nb_schemas_tests = nb_schemas_tests + 1;
valids = node.xpathEval('valid')
invalids = node.xpathEval('invalid')
nb_instances_tests = nb_instances_tests + len(valids) + len(invalids)
if schema != None:
for valid in valids:
handle_valid(valid, schema)
for invalid in invalids:
handle_invalid(invalid, schema)
#
# handle a testSuite element
#
def handle_testSuite(node, level = 0):
global nb_schemas_tests, nb_schemas_success, nb_schemas_failed
global nb_instances_tests, nb_instances_success, nb_instances_failed
if verbose and level >= 0:
old_schemas_tests = nb_schemas_tests
old_schemas_success = nb_schemas_success
old_schemas_failed = nb_schemas_failed
old_instances_tests = nb_instances_tests
old_instances_success = nb_instances_success
old_instances_failed = nb_instances_failed
docs = node.xpathEval('documentation')
authors = node.xpathEval('author')
if docs != []:
msg = ""
for doc in docs:
msg = msg + doc.content + " "
if authors != []:
msg = msg + "written by "
for author in authors:
msg = msg + author.content + " "
if quiet == 0:
print msg
sections = node.xpathEval('section')
if verbose and sections != [] and level <= 0:
msg = ""
for section in sections:
msg = msg + section.content + " "
if quiet == 0:
print "Tests for section %s" % (msg)
for test in node.xpathEval('testCase'):
handle_testCase(test)
for test in node.xpathEval('testSuite'):
handle_testSuite(test, level + 1)
if verbose and level >= 0 :
if sections != []:
msg = ""
for section in sections:
msg = msg + section.content + " "
print "Result of tests for section %s" % (msg)
elif docs != []:
msg = ""
for doc in docs:
msg = msg + doc.content + " "
print "Result of tests for %s" % (msg)
if nb_schemas_tests != old_schemas_tests:
print "found %d test schemas: %d success %d failures" % (
nb_schemas_tests - old_schemas_tests,
nb_schemas_success - old_schemas_success,
nb_schemas_failed - old_schemas_failed)
if nb_instances_tests != old_instances_tests:
print "found %d test instances: %d success %d failures" % (
nb_instances_tests - old_instances_tests,
nb_instances_success - old_instances_success,
nb_instances_failed - old_instances_failed)
#
# Parse the conf file
#
libxml2.substituteEntitiesDefault(1);
testsuite = libxml2.parseFile(CONF)
#
# Error and warnng callbacks
#
def callback(ctx, str):
global log
log.write("%s%s" % (ctx, str))
libxml2.registerErrorHandler(callback, "")
libxml2.setEntityLoader(resolver)
root = testsuite.getRootElement()
if root.name != 'testSuite':
print "%s doesn't start with a testSuite element, aborting" % (CONF)
sys.exit(1)
if quiet == 0:
print "Running Relax NG testsuite"
handle_testSuite(root)
if quiet == 0 or nb_schemas_failed != 0:
print "\nTOTAL:\nfound %d test schemas: %d success %d failures" % (
nb_schemas_tests, nb_schemas_success, nb_schemas_failed)
if quiet == 0 or nb_instances_failed != 0:
print "found %d test instances: %d success %d failures" % (
nb_instances_tests, nb_instances_success, nb_instances_failed)
testsuite.freeDoc()
# Memory debug specific
libxml2.relaxNGCleanupTypes()
libxml2.cleanupParser()
if libxml2.debugMemory(1) == 0:
if quiet == 0:
print "OK"
else:
print "Memory leak %d bytes" % (libxml2.debugMemory(1))
libxml2.dumpMemory()

View file

@ -0,0 +1,333 @@
/*
* chvalid.c: this module implements the character range
* validation APIs
*
* This file is automatically generated from the cvs source
* definition files using the genChRanges.py Python script
*
* Generation date: Tue Nov 18 08:14:21 2003
* Sources: chvalid.def
* William Brack <wbrack@mmm.com.hk>
*/
#define IN_LIBXML
#include "libxml.h"
#include <libxml/chvalid.h>
/*
* The initial tables ({func_name}_tab) are used to validate whether a
* single-byte character is within the specified group. Each table
* contains 256 bytes, with each byte representing one of the 256
* possible characters. If the table byte is set, the character is
* allowed.
*
*/
unsigned char xmlIsPubidChar_tab[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00 };
static xmlChSRange xmlIsBaseChar_srng[] = { {0x100, 0x131}, {0x134, 0x13e},
{0x141, 0x148}, {0x14a, 0x17e}, {0x180, 0x1c3}, {0x1cd, 0x1f0},
{0x1f4, 0x1f5}, {0x1fa, 0x217}, {0x250, 0x2a8}, {0x2bb, 0x2c1},
{0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c}, {0x38e, 0x3a1},
{0x3a3, 0x3ce}, {0x3d0, 0x3d6}, {0x3da, 0x3da}, {0x3dc, 0x3dc},
{0x3de, 0x3de}, {0x3e0, 0x3e0}, {0x3e2, 0x3f3}, {0x401, 0x40c},
{0x40e, 0x44f}, {0x451, 0x45c}, {0x45e, 0x481}, {0x490, 0x4c4},
{0x4c7, 0x4c8}, {0x4cb, 0x4cc}, {0x4d0, 0x4eb}, {0x4ee, 0x4f5},
{0x4f8, 0x4f9}, {0x531, 0x556}, {0x559, 0x559}, {0x561, 0x586},
{0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, {0x641, 0x64a},
{0x671, 0x6b7}, {0x6ba, 0x6be}, {0x6c0, 0x6ce}, {0x6d0, 0x6d3},
{0x6d5, 0x6d5}, {0x6e5, 0x6e6}, {0x905, 0x939}, {0x93d, 0x93d},
{0x958, 0x961}, {0x985, 0x98c}, {0x98f, 0x990}, {0x993, 0x9a8},
{0x9aa, 0x9b0}, {0x9b2, 0x9b2}, {0x9b6, 0x9b9}, {0x9dc, 0x9dd},
{0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a}, {0xa0f, 0xa10},
{0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33}, {0xa35, 0xa36},
{0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e}, {0xa72, 0xa74},
{0xa85, 0xa8b}, {0xa8d, 0xa8d}, {0xa8f, 0xa91}, {0xa93, 0xaa8},
{0xaaa, 0xab0}, {0xab2, 0xab3}, {0xab5, 0xab9}, {0xabd, 0xabd},
{0xae0, 0xae0}, {0xb05, 0xb0c}, {0xb0f, 0xb10}, {0xb13, 0xb28},
{0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb36, 0xb39}, {0xb3d, 0xb3d},
{0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb85, 0xb8a}, {0xb8e, 0xb90},
{0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c}, {0xb9e, 0xb9f},
{0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5}, {0xbb7, 0xbb9},
{0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, {0xc2a, 0xc33},
{0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c}, {0xc8e, 0xc90},
{0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, {0xcde, 0xcde},
{0xce0, 0xce1}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, {0xd12, 0xd28},
{0xd2a, 0xd39}, {0xd60, 0xd61}, {0xe01, 0xe2e}, {0xe30, 0xe30},
{0xe32, 0xe33}, {0xe40, 0xe45}, {0xe81, 0xe82}, {0xe84, 0xe84},
{0xe87, 0xe88}, {0xe8a, 0xe8a}, {0xe8d, 0xe8d}, {0xe94, 0xe97},
{0xe99, 0xe9f}, {0xea1, 0xea3}, {0xea5, 0xea5}, {0xea7, 0xea7},
{0xeaa, 0xeab}, {0xead, 0xeae}, {0xeb0, 0xeb0}, {0xeb2, 0xeb3},
{0xebd, 0xebd}, {0xec0, 0xec4}, {0xf40, 0xf47}, {0xf49, 0xf69},
{0x10a0, 0x10c5}, {0x10d0, 0x10f6}, {0x1100, 0x1100}, {0x1102, 0x1103},
{0x1105, 0x1107}, {0x1109, 0x1109}, {0x110b, 0x110c}, {0x110e, 0x1112},
{0x113c, 0x113c}, {0x113e, 0x113e}, {0x1140, 0x1140}, {0x114c, 0x114c},
{0x114e, 0x114e}, {0x1150, 0x1150}, {0x1154, 0x1155}, {0x1159, 0x1159},
{0x115f, 0x1161}, {0x1163, 0x1163}, {0x1165, 0x1165}, {0x1167, 0x1167},
{0x1169, 0x1169}, {0x116d, 0x116e}, {0x1172, 0x1173}, {0x1175, 0x1175},
{0x119e, 0x119e}, {0x11a8, 0x11a8}, {0x11ab, 0x11ab}, {0x11ae, 0x11af},
{0x11b7, 0x11b8}, {0x11ba, 0x11ba}, {0x11bc, 0x11c2}, {0x11eb, 0x11eb},
{0x11f0, 0x11f0}, {0x11f9, 0x11f9}, {0x1e00, 0x1e9b}, {0x1ea0, 0x1ef9},
{0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, {0x1f48, 0x1f4d},
{0x1f50, 0x1f57}, {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b}, {0x1f5d, 0x1f5d},
{0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc}, {0x1fbe, 0x1fbe},
{0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, {0x1fd6, 0x1fdb},
{0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, {0x2126, 0x2126},
{0x212a, 0x212b}, {0x212e, 0x212e}, {0x2180, 0x2182}, {0x3041, 0x3094},
{0x30a1, 0x30fa}, {0x3105, 0x312c}, {0xac00, 0xd7a3}};
xmlChRangeGroup xmlIsBaseCharGroup =
{197, 0, xmlIsBaseChar_srng, (xmlChLRangePtr)0};
static xmlChSRange xmlIsChar_srng[] = { {0x100, 0xd7ff}, {0xe000, 0xfffd}};
static xmlChLRange xmlIsChar_lrng[] = { {0x10000, 0x10ffff}};
xmlChRangeGroup xmlIsCharGroup =
{2, 1, xmlIsChar_srng, xmlIsChar_lrng};
static xmlChSRange xmlIsCombining_srng[] = { {0x300, 0x345},
{0x360, 0x361}, {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9},
{0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4},
{0x64b, 0x652}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6dd, 0x6df},
{0x6e0, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x901, 0x903},
{0x93c, 0x93c}, {0x93e, 0x94c}, {0x94d, 0x94d}, {0x951, 0x954},
{0x962, 0x963}, {0x981, 0x983}, {0x9bc, 0x9bc}, {0x9be, 0x9be},
{0x9bf, 0x9bf}, {0x9c0, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd},
{0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa02, 0xa02}, {0xa3c, 0xa3c},
{0xa3e, 0xa3e}, {0xa3f, 0xa3f}, {0xa40, 0xa42}, {0xa47, 0xa48},
{0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa83}, {0xabc, 0xabc},
{0xabe, 0xac5}, {0xac7, 0xac9}, {0xacb, 0xacd}, {0xb01, 0xb03},
{0xb3c, 0xb3c}, {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d},
{0xb56, 0xb57}, {0xb82, 0xb83}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8},
{0xbca, 0xbcd}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44},
{0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83},
{0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6},
{0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d},
{0xd57, 0xd57}, {0xe31, 0xe31}, {0xe34, 0xe3a}, {0xe47, 0xe4e},
{0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, {0xec8, 0xecd},
{0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, {0xf39, 0xf39},
{0xf3e, 0xf3e}, {0xf3f, 0xf3f}, {0xf71, 0xf84}, {0xf86, 0xf8b},
{0xf90, 0xf95}, {0xf97, 0xf97}, {0xf99, 0xfad}, {0xfb1, 0xfb7},
{0xfb9, 0xfb9}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, {0x302a, 0x302f},
{0x3099, 0x3099}, {0x309a, 0x309a}};
xmlChRangeGroup xmlIsCombiningGroup =
{95, 0, xmlIsCombining_srng, (xmlChLRangePtr)0};
static xmlChSRange xmlIsDigit_srng[] = { {0x660, 0x669}, {0x6f0, 0x6f9},
{0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f}, {0xae6, 0xaef},
{0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f}, {0xce6, 0xcef},
{0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, {0xf20, 0xf29}};
xmlChRangeGroup xmlIsDigitGroup =
{14, 0, xmlIsDigit_srng, (xmlChLRangePtr)0};
static xmlChSRange xmlIsExtender_srng[] = { {0x2d0, 0x2d0}, {0x2d1, 0x2d1},
{0x387, 0x387}, {0x640, 0x640}, {0xe46, 0xe46}, {0xec6, 0xec6},
{0x3005, 0x3005}, {0x3031, 0x3035}, {0x309d, 0x309e}, {0x30fc, 0x30fe}};
xmlChRangeGroup xmlIsExtenderGroup =
{10, 0, xmlIsExtender_srng, (xmlChLRangePtr)0};
static xmlChSRange xmlIsIdeographic_srng[] = { {0x3007, 0x3007},
{0x3021, 0x3029}, {0x4e00, 0x9fa5}};
xmlChRangeGroup xmlIsIdeographicGroup =
{3, 0, xmlIsIdeographic_srng, (xmlChLRangePtr)0};
/**
* xmlCharInRange:
* @val: character to be validated
* @rptr: pointer to range to be used to validate
*
* Does a binary search of the range table to determine if char
* is valid
*
* Returns: true if character valid, false otherwise
*/
int
xmlCharInRange (unsigned int val, const xmlChRangeGroupPtr rptr) {
int low, high, mid;
xmlChSRangePtr sptr;
xmlChLRangePtr lptr;
if (rptr == NULL) return(0);
if (val < 0x10000) { /* is val in 'short' or 'long' array? */
if (rptr->nbShortRange == 0)
return 0;
low = 0;
high = rptr->nbShortRange - 1;
sptr = rptr->shortRange;
while (low <= high) {
mid = (low + high) / 2;
if ((unsigned short) val < sptr[mid].low) {
high = mid - 1;
} else {
if ((unsigned short) val > sptr[mid].high) {
low = mid + 1;
} else {
return 1;
}
}
}
} else {
if (rptr->nbLongRange == 0) {
return 0;
}
low = 0;
high = rptr->nbLongRange - 1;
lptr = rptr->longRange;
while (low <= high) {
mid = (low + high) / 2;
if (val < lptr[mid].low) {
high = mid - 1;
} else {
if (val > lptr[mid].high) {
low = mid + 1;
} else {
return 1;
}
}
}
}
return 0;
}
/**
* xmlIsBaseChar:
* @ch: character to validate
*
* This function is DEPRECATED.
* Use xmlIsBaseChar_ch or xmlIsBaseCharQ instead
*
* Returns true if argument valid, false otherwise
*/
int
xmlIsBaseChar(unsigned int ch) {
return(xmlIsBaseCharQ(ch));
}
/**
* xmlIsBlank:
* @ch: character to validate
*
* This function is DEPRECATED.
* Use xmlIsBlank_ch or xmlIsBlankQ instead
*
* Returns true if argument valid, false otherwise
*/
int
xmlIsBlank(unsigned int ch) {
return(xmlIsBlankQ(ch));
}
/**
* xmlIsChar:
* @ch: character to validate
*
* This function is DEPRECATED.
* Use xmlIsChar_ch or xmlIsCharQ instead
*
* Returns true if argument valid, false otherwise
*/
int
xmlIsChar(unsigned int ch) {
return(xmlIsCharQ(ch));
}
/**
* xmlIsCombining:
* @ch: character to validate
*
* This function is DEPRECATED.
* Use xmlIsCombiningQ instead
*
* Returns true if argument valid, false otherwise
*/
int
xmlIsCombining(unsigned int ch) {
return(xmlIsCombiningQ(ch));
}
/**
* xmlIsDigit:
* @ch: character to validate
*
* This function is DEPRECATED.
* Use xmlIsDigit_ch or xmlIsDigitQ instead
*
* Returns true if argument valid, false otherwise
*/
int
xmlIsDigit(unsigned int ch) {
return(xmlIsDigitQ(ch));
}
/**
* xmlIsExtender:
* @ch: character to validate
*
* This function is DEPRECATED.
* Use xmlIsExtender_ch or xmlIsExtenderQ instead
*
* Returns true if argument valid, false otherwise
*/
int
xmlIsExtender(unsigned int ch) {
return(xmlIsExtenderQ(ch));
}
/**
* xmlIsIdeographic:
* @ch: character to validate
*
* This function is DEPRECATED.
* Use xmlIsIdeographicQ instead
*
* Returns true if argument valid, false otherwise
*/
int
xmlIsIdeographic(unsigned int ch) {
return(xmlIsIdeographicQ(ch));
}
/**
* xmlIsPubidChar:
* @ch: character to validate
*
* This function is DEPRECATED.
* Use xmlIsPubidChar_ch or xmlIsPubidCharQ instead
*
* Returns true if argument valid, false otherwise
*/
int
xmlIsPubidChar(unsigned int ch) {
return(xmlIsPubidCharQ(ch));
}
#define bottom_chvalid
#include "elfgcchack.h"

1411
reactos/lib/libxml2/config.guess vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,302 @@
/* config.h. Generated by configure. */
/* config.h.in. Generated from configure.in by autoheader. */
#define PACKAGE "libxml2"
#define VERSION "2.6.20"
/* #undef HAVE_LIBZ */
/* #undef HAVE_LIBM */
/* #undef HAVE_ISINF */
#define HAVE_ISNAN
/* #undef HAVE_LIBHISTORY */
/* #undef HAVE_LIBREADLINE */
/* #undef HAVE_LIBPTHREAD */
/* #undef HAVE_PTHREAD_H */
/* Define if IPV6 support is there */
/* #undef SUPPORT_IP6 */
/* Define if getaddrinfo is there */
/* #undef HAVE_GETADDRINFO */
/* Define to 1 if you have the <ansidecl.h> header file. */
#define HAVE_ANSIDECL_H 1
/* Define to 1 if you have the <arpa/inet.h> header file. */
/* #undef HAVE_ARPA_INET_H */
/* Define to 1 if you have the <arpa/nameser.h> header file. */
/* #undef HAVE_ARPA_NAMESER_H */
/* Whether struct sockaddr::__ss_family exists */
/* #undef HAVE_BROKEN_SS_FAMILY */
/* Define to 1 if you have the `class' function. */
/* #undef HAVE_CLASS */
/* Define to 1 if you have the <ctype.h> header file. */
#define HAVE_CTYPE_H 1
/* Define to 1 if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H 1
/* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef HAVE_DLFCN_H */
/* Have dlopen based dso */
/* #undef HAVE_DLOPEN */
/* Define to 1 if you have the <dl.h> header file. */
/* #undef HAVE_DL_H */
/* Define to 1 if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `finite' function. */
#define HAVE_FINITE 1
/* Define to 1 if you have the <float.h> header file. */
#define HAVE_FLOAT_H 1
/* Define to 1 if you have the `fpclass' function. */
#define HAVE_FPCLASS 1
/* Define to 1 if you have the `fprintf' function. */
#define HAVE_FPRINTF 1
/* Define to 1 if you have the `fp_class' function. */
/* #undef HAVE_FP_CLASS */
/* Define to 1 if you have the <fp_class.h> header file. */
/* #undef HAVE_FP_CLASS_H */
/* Define to 1 if you have the `ftime' function. */
#define HAVE_FTIME 1
/* Define if getaddrinfo is there */
/* #undef HAVE_GETADDRINFO */
/* Define to 1 if you have the `gettimeofday' function. */
/* #undef HAVE_GETTIMEOFDAY */
/* Define to 1 if you have the <ieeefp.h> header file. */
/* #undef HAVE_IEEEFP_H */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define if isinf is there */
/* #undef HAVE_ISINF */
/* Define if isnan is there */
#define HAVE_ISNAN
/* Define to 1 if you have the `isnand' function. */
/* #undef HAVE_ISNAND */
/* Define if history library is there (-lhistory) */
/* #undef HAVE_LIBHISTORY */
/* Define to 1 if you have the `inet' library (-linet). */
/* #undef HAVE_LIBINET */
/* Define to 1 if you have the `net' library (-lnet). */
/* #undef HAVE_LIBNET */
/* Define to 1 if you have the `nsl' library (-lnsl). */
/* #undef HAVE_LIBNSL */
/* Define if pthread library is there (-lpthread) */
/* #undef HAVE_LIBPTHREAD */
/* Define if readline library is there (-lreadline) */
/* #undef HAVE_LIBREADLINE */
/* Define to 1 if you have the `socket' library (-lsocket). */
/* #undef HAVE_LIBSOCKET */
/* Have compression library */
/* #undef HAVE_LIBZ */
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the `localtime' function. */
#define HAVE_LOCALTIME 1
/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define to 1 if you have the <math.h> header file. */
#define HAVE_MATH_H 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <nan.h> header file. */
/* #undef HAVE_NAN_H */
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the <netdb.h> header file. */
/* #undef HAVE_NETDB_H */
/* Define to 1 if you have the <netinet/in.h> header file. */
/* #undef HAVE_NETINET_IN_H */
/* Define to 1 if you have the `printf' function. */
#define HAVE_PRINTF 1
/* Define if <pthread.h> is there */
/* #undef HAVE_PTHREAD_H */
/* Define to 1 if you have the <resolv.h> header file. */
/* #undef HAVE_RESOLV_H */
/* Have shl_load based dso */
/* #undef HAVE_SHLLOAD */
/* Define to 1 if you have the `signal' function. */
#define HAVE_SIGNAL 1
/* Define to 1 if you have the <signal.h> header file. */
#define HAVE_SIGNAL_H 1
/* Define to 1 if you have the `snprintf' function. */
#define HAVE_SNPRINTF 1
/* Define to 1 if you have the `sprintf' function. */
#define HAVE_SPRINTF 1
/* Define to 1 if you have the `sscanf' function. */
#define HAVE_SSCANF 1
/* Define to 1 if you have the `stat' function. */
#define HAVE_STAT 1
/* Define to 1 if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the `strftime' function. */
#define HAVE_STRFTIME 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strndup' function. */
/* #undef HAVE_STRNDUP */
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/mman.h> header file. */
/* #undef HAVE_SYS_MMAN_H */
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/select.h> header file. */
/* #undef HAVE_SYS_SELECT_H */
/* Define to 1 if you have the <sys/socket.h> header file. */
/* #undef HAVE_SYS_SOCKET_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/timeb.h> header file. */
#define HAVE_SYS_TIMEB_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `vfprintf' function. */
#define HAVE_VFPRINTF 1
/* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1
/* Define to 1 if you have the `vsprintf' function. */
#define HAVE_VSPRINTF 1
/* Define to 1 if you have the <zlib.h> header file. */
/* #undef HAVE_ZLIB_H */
/* Define to 1 if you have the `_stat' function. */
#define HAVE__STAT 1
/* Name of package */
#define PACKAGE "libxml2"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
/* Define to 1 if the C compiler supports function prototypes. */
#define PROTOTYPES 1
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Support for IPv6 */
/* #undef SUPPORT_IP6 */
/* Version number of package */
#define VERSION "2.6.20"
/* Determine what socket length (socklen_t) data type is */
#define XML_SOCKLEN_T int
/* Using the Win32 Socket implementation */
#define _WINSOCKAPI_ 1
/* Define like PROTOTYPES; this can be used by system headers. */
#define __PROTOTYPES 1
/* Win32 Std C name mangling work-around */
#define snprintf _snprintf
/* ss_family is not defined here, use __ss_family instead */
/* #undef ss_family */
/* Win32 Std C name mangling work-around */
#define vsnprintf _vsnprintf

View file

@ -0,0 +1,301 @@
/* config.h.in. Generated from configure.in by autoheader. */
#undef PACKAGE
#undef VERSION
#undef HAVE_LIBZ
#undef HAVE_LIBM
#undef HAVE_ISINF
#undef HAVE_ISNAN
#undef HAVE_LIBHISTORY
#undef HAVE_LIBREADLINE
#undef HAVE_LIBPTHREAD
#undef HAVE_PTHREAD_H
/* Define if IPV6 support is there */
#undef SUPPORT_IP6
/* Define if getaddrinfo is there */
#undef HAVE_GETADDRINFO
/* Define to 1 if you have the <ansidecl.h> header file. */
#undef HAVE_ANSIDECL_H
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the <arpa/nameser.h> header file. */
#undef HAVE_ARPA_NAMESER_H
/* Whether struct sockaddr::__ss_family exists */
#undef HAVE_BROKEN_SS_FAMILY
/* Define to 1 if you have the `class' function. */
#undef HAVE_CLASS
/* Define to 1 if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Have dlopen based dso */
#undef HAVE_DLOPEN
/* Define to 1 if you have the <dl.h> header file. */
#undef HAVE_DL_H
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `finite' function. */
#undef HAVE_FINITE
/* Define to 1 if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
/* Define to 1 if you have the `fpclass' function. */
#undef HAVE_FPCLASS
/* Define to 1 if you have the `fprintf' function. */
#undef HAVE_FPRINTF
/* Define to 1 if you have the `fp_class' function. */
#undef HAVE_FP_CLASS
/* Define to 1 if you have the <fp_class.h> header file. */
#undef HAVE_FP_CLASS_H
/* Define to 1 if you have the `ftime' function. */
#undef HAVE_FTIME
/* Define if getaddrinfo is there */
#undef HAVE_GETADDRINFO
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the <ieeefp.h> header file. */
#undef HAVE_IEEEFP_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if isinf is there */
#undef HAVE_ISINF
/* Define if isnan is there */
#undef HAVE_ISNAN
/* Define to 1 if you have the `isnand' function. */
#undef HAVE_ISNAND
/* Define if history library is there (-lhistory) */
#undef HAVE_LIBHISTORY
/* Define to 1 if you have the `inet' library (-linet). */
#undef HAVE_LIBINET
/* Define to 1 if you have the `net' library (-lnet). */
#undef HAVE_LIBNET
/* Define to 1 if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL
/* Define if pthread library is there (-lpthread) */
#undef HAVE_LIBPTHREAD
/* Define if readline library is there (-lreadline) */
#undef HAVE_LIBREADLINE
/* Define to 1 if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Have compression library */
#undef HAVE_LIBZ
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the `localtime' function. */
#undef HAVE_LOCALTIME
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the <math.h> header file. */
#undef HAVE_MATH_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <nan.h> header file. */
#undef HAVE_NAN_H
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if you have the `printf' function. */
#undef HAVE_PRINTF
/* Define if <pthread.h> is there */
#undef HAVE_PTHREAD_H
/* Define to 1 if you have the <resolv.h> header file. */
#undef HAVE_RESOLV_H
/* Have shl_load based dso */
#undef HAVE_SHLLOAD
/* Define to 1 if you have the `signal' function. */
#undef HAVE_SIGNAL
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the `sprintf' function. */
#undef HAVE_SPRINTF
/* Define to 1 if you have the `sscanf' function. */
#undef HAVE_SSCANF
/* Define to 1 if you have the `stat' function. */
#undef HAVE_STAT
/* Define to 1 if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strndup' function. */
#undef HAVE_STRNDUP
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H
/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_NDIR_H
/* Define to 1 if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/timeb.h> header file. */
#undef HAVE_SYS_TIMEB_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <time.h> header file. */
#undef HAVE_TIME_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vfprintf' function. */
#undef HAVE_VFPRINTF
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* Define to 1 if you have the `vsprintf' function. */
#undef HAVE_VSPRINTF
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Define to 1 if you have the `_stat' function. */
#undef HAVE__STAT
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if the C compiler supports function prototypes. */
#undef PROTOTYPES
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Support for IPv6 */
#undef SUPPORT_IP6
/* Version number of package */
#undef VERSION
/* Determine what socket length (socklen_t) data type is */
#undef XML_SOCKLEN_T
/* Using the Win32 Socket implementation */
#undef _WINSOCKAPI_
/* Define like PROTOTYPES; this can be used by system headers. */
#undef __PROTOTYPES
/* Win32 Std C name mangling work-around */
#undef snprintf
/* ss_family is not defined here, use __ss_family instead */
#undef ss_family
/* Win32 Std C name mangling work-around */
#undef vsnprintf

1500
reactos/lib/libxml2/config.sub vendored Normal file

File diff suppressed because it is too large Load diff

30902
reactos/lib/libxml2/configure vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,43 @@
#!/usr/bin/perl
$size = shift;
if ($size eq "")
{
die "usage: dbgen.pl [size]\n";
}
@firstnames = ("Al", "Bob", "Charles", "David", "Egon", "Farbood",
"George", "Hank", "Inki", "James");
@lastnames = ("Aranow", "Barker", "Corsetti", "Dershowitz", "Engleman",
"Franklin", "Grice", "Haverford", "Ilvedson", "Jones");
@states = ("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA",
"HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
"MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
"SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY");
print "<?xml version=\"1.0\"?>\n";
print "\n";
print "<table>\n";
for ($i=0; $i<$size; $i++)
{
$first = $firstnames [$i % 10];
$last = $lastnames [($i / 10) % 10];
$state = $states [($i / 100) % 50];
$zip = 22000 + $i / 5000;
printf " <row>\n";
printf " <id>%04d</id>\n", $i;
printf " <firstname>$first</firstname>\n", $i;
printf " <lastname>$last</lastname>\n", $i;
printf " <street>%d Any St.</street>\n", ($i % 100) + 1;
printf " <city>Anytown</city>\n";
printf " <state>$state</state>\n";
printf " <zip>%d</zip>\n", $zip;
printf " </row>\n";
}
print "</table>\n";

View file

@ -0,0 +1,42 @@
#!/usr/bin/perl
$size = shift;
if ($size eq "")
{
die "usage: dbgen.pl [size]\n";
}
@firstnames = ("Al", "Bob", "Charles", "David", "Egon", "Farbood",
"George", "Hank", "Inki", "James");
@lastnames = ("Aranow", "Barker", "Corsetti", "Dershowitz", "Engleman",
"Franklin", "Grice", "Haverford", "Ilvedson", "Jones");
@states = ("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA",
"HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
"MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
"SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY");
print "<?xml version=\"1.0\"?>\n";
print "\n";
print "<table>\n";
for ($i=0; $i<$size; $i++)
{
$first = $firstnames [$i % 10];
$last = $lastnames [($i / 10) % 10];
$state = $states [($i / 100) % 50];
$zip = 22000 + $i / 5000;
printf " <row\n";
printf " id='%04d'\n", $i;
printf " firstname='$first'\n", $i;
printf " lastname='$last'\n", $i;
printf " street='%d Any St.'\n", ($i % 100) + 1;
printf " city='Anytown'\n";
printf " state='$state'\n";
printf " zip='%d'/>\n", $zip;
}
print "</table>\n";

File diff suppressed because it is too large Load diff

522
reactos/lib/libxml2/depcomp Normal file
View file

@ -0,0 +1,522 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2004-05-31.23
# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit 0
;;
-v | --v*)
echo "depcomp $scriptversion"
exit 0
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# Dependencies are output in .lo.d with libtool 1.4.
# With libtool 1.5 they are output both in $dir.libs/$base.o.d
# and in $dir.libs/$base.o.d and $dir$base.o.d. We process the
# latter, because the former will be cleaned when $dir.libs is
# erased.
tmpdepfile1="$dir.libs/$base.lo.d"
tmpdepfile2="$dir$base.o.d"
tmpdepfile3="$dir.libs/$base.d"
"$@" -Wc,-MD
else
tmpdepfile1="$dir$base.o.d"
tmpdepfile2="$dir$base.d"
tmpdepfile3="$dir$base.d"
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
if test -f "$tmpdepfile1"; then
tmpdepfile="$tmpdepfile1"
elif test -f "$tmpdepfile2"; then
tmpdepfile="$tmpdepfile2"
else
tmpdepfile="$tmpdepfile3"
fi
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

901
reactos/lib/libxml2/dict.c Normal file
View file

@ -0,0 +1,901 @@
/*
* dict.c: dictionary of reusable strings, just used to avoid allocation
* and freeing operations.
*
* Copyright (C) 2003 Daniel Veillard.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
* Author: daniel@veillard.com
*/
#define IN_LIBXML
#include "libxml.h"
#include <string.h>
#include <libxml/tree.h>
#include <libxml/dict.h>
#include <libxml/xmlmemory.h>
#include <libxml/xmlerror.h>
#include <libxml/globals.h>
#define MAX_HASH_LEN 4
#define MIN_DICT_SIZE 128
#define MAX_DICT_HASH 8 * 2048
/* #define ALLOW_REMOVAL */
/* #define DEBUG_GROW */
/*
* An entry in the dictionnary
*/
typedef struct _xmlDictEntry xmlDictEntry;
typedef xmlDictEntry *xmlDictEntryPtr;
struct _xmlDictEntry {
struct _xmlDictEntry *next;
const xmlChar *name;
int len;
int valid;
};
typedef struct _xmlDictStrings xmlDictStrings;
typedef xmlDictStrings *xmlDictStringsPtr;
struct _xmlDictStrings {
xmlDictStringsPtr next;
xmlChar *free;
xmlChar *end;
int size;
int nbStrings;
xmlChar array[1];
};
/*
* The entire dictionnary
*/
struct _xmlDict {
int ref_counter;
xmlRMutexPtr mutex;
struct _xmlDictEntry *dict;
int size;
int nbElems;
xmlDictStringsPtr strings;
struct _xmlDict *subdict;
};
/*
* A mutex for modifying the reference counter for shared
* dictionaries.
*/
static xmlRMutexPtr xmlDictMutex = NULL;
/*
* Whether the dictionary mutex was initialized.
*/
static int xmlDictInitialized = 0;
/**
* xmlInitializeDict:
*
* Do the dictionary mutex initialization.
* this function is not thread safe, initialization should
* preferably be done once at startup
*/
static int xmlInitializeDict(void) {
if (xmlDictInitialized)
return(1);
if ((xmlDictMutex = xmlNewRMutex()) == NULL)
return(0);
xmlDictInitialized = 1;
return(1);
}
/**
* xmlDictCleanup:
*
* Free the dictionary mutex.
*/
void
xmlDictCleanup(void) {
if (!xmlDictInitialized)
return;
xmlFreeRMutex(xmlDictMutex);
xmlDictInitialized = 0;
}
/*
* xmlDictAddString:
* @dict: the dictionnary
* @name: the name of the userdata
* @len: the length of the name, if -1 it is recomputed
*
* Add the string to the array[s]
*
* Returns the pointer of the local string, or NULL in case of error.
*/
static const xmlChar *
xmlDictAddString(xmlDictPtr dict, const xmlChar *name, int namelen) {
xmlDictStringsPtr pool;
const xmlChar *ret;
int size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
pool = dict->strings;
while (pool != NULL) {
if (pool->end - pool->free > namelen)
goto found_pool;
if (pool->size > size) size = pool->size;
pool = pool->next;
}
/*
* Not found, need to allocate
*/
if (pool == NULL) {
if (size == 0) size = 1000;
else size *= 4; /* exponential growth */
if (size < 4 * namelen)
size = 4 * namelen; /* just in case ! */
pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size);
if (pool == NULL)
return(NULL);
pool->size = size;
pool->nbStrings = 0;
pool->free = &pool->array[0];
pool->end = &pool->array[size];
pool->next = dict->strings;
dict->strings = pool;
}
found_pool:
ret = pool->free;
memcpy(pool->free, name, namelen);
pool->free += namelen;
*(pool->free++) = 0;
return(ret);
}
/*
* xmlDictAddQString:
* @dict: the dictionnary
* @prefix: the prefix of the userdata
* @name: the name of the userdata
* @len: the length of the name, if -1 it is recomputed
*
* Add the QName to the array[s]
*
* Returns the pointer of the local string, or NULL in case of error.
*/
static const xmlChar *
xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix,
const xmlChar *name, int namelen)
{
xmlDictStringsPtr pool;
const xmlChar *ret;
int size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
int plen;
if (prefix == NULL) return(xmlDictAddString(dict, name, namelen));
plen = xmlStrlen(prefix);
pool = dict->strings;
while (pool != NULL) {
if (pool->end - pool->free > namelen)
goto found_pool;
if (pool->size > size) size = pool->size;
pool = pool->next;
}
/*
* Not found, need to allocate
*/
if (pool == NULL) {
if (size == 0) size = 1000;
else size *= 4; /* exponential growth */
if (size < 4 * namelen)
size = 4 * namelen; /* just in case ! */
pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size);
if (pool == NULL)
return(NULL);
pool->size = size;
pool->nbStrings = 0;
pool->free = &pool->array[0];
pool->end = &pool->array[size];
pool->next = dict->strings;
dict->strings = pool;
}
found_pool:
ret = pool->free;
memcpy(pool->free, prefix, plen);
pool->free += plen;
*(pool->free++) = ':';
namelen -= plen + 1;
memcpy(pool->free, name, namelen);
pool->free += namelen;
*(pool->free++) = 0;
return(ret);
}
/*
* xmlDictComputeKey:
* Calculate the hash key
*/
static unsigned long
xmlDictComputeKey(const xmlChar *name, int namelen) {
unsigned long value = 0L;
if (name == NULL) return(0);
value = *name;
value <<= 5;
if (namelen > 10) {
value += name[namelen - 1];
namelen = 10;
}
switch (namelen) {
case 10: value += name[9];
case 9: value += name[8];
case 8: value += name[7];
case 7: value += name[6];
case 6: value += name[5];
case 5: value += name[4];
case 4: value += name[3];
case 3: value += name[2];
case 2: value += name[1];
default: break;
}
return(value);
}
/*
* xmlDictComputeQKey:
* Calculate the hash key
*/
static unsigned long
xmlDictComputeQKey(const xmlChar *prefix, const xmlChar *name, int len)
{
unsigned long value = 0L;
int plen;
if (prefix == NULL)
return(xmlDictComputeKey(name, len));
plen = xmlStrlen(prefix);
if (plen == 0)
value += 30 * (unsigned long) ':';
else
value += 30 * (*prefix);
if (len > 10) {
value += name[len - (plen + 1 + 1)];
len = 10;
if (plen > 10)
plen = 10;
}
switch (plen) {
case 10: value += prefix[9];
case 9: value += prefix[8];
case 8: value += prefix[7];
case 7: value += prefix[6];
case 6: value += prefix[5];
case 5: value += prefix[4];
case 4: value += prefix[3];
case 3: value += prefix[2];
case 2: value += prefix[1];
case 1: value += prefix[0];
default: break;
}
len -= plen;
if (len > 0) {
value += (unsigned long) ':';
len--;
}
switch (len) {
case 10: value += name[9];
case 9: value += name[8];
case 8: value += name[7];
case 7: value += name[6];
case 6: value += name[5];
case 5: value += name[4];
case 4: value += name[3];
case 3: value += name[2];
case 2: value += name[1];
case 1: value += name[0];
default: break;
}
return(value);
}
/**
* xmlDictCreate:
*
* Create a new dictionary
*
* Returns the newly created dictionnary, or NULL if an error occured.
*/
xmlDictPtr
xmlDictCreate(void) {
xmlDictPtr dict;
if (!xmlDictInitialized)
if (!xmlInitializeDict())
return(NULL);
dict = xmlMalloc(sizeof(xmlDict));
if (dict) {
dict->ref_counter = 1;
dict->size = MIN_DICT_SIZE;
dict->nbElems = 0;
dict->dict = xmlMalloc(MIN_DICT_SIZE * sizeof(xmlDictEntry));
dict->strings = NULL;
dict->subdict = NULL;
if (dict->dict) {
if ((dict->mutex = xmlNewRMutex()) != NULL) {
memset(dict->dict, 0, MIN_DICT_SIZE * sizeof(xmlDictEntry));
return(dict);
}
xmlFree(dict->dict);
}
xmlFree(dict);
}
return(NULL);
}
/**
* xmlDictCreateSub:
* @sub: an existing dictionnary
*
* Create a new dictionary, inheriting strings from the read-only
* dictionnary @sub. On lookup, strings are first searched in the
* new dictionnary, then in @sub, and if not found are created in the
* new dictionnary.
*
* Returns the newly created dictionnary, or NULL if an error occured.
*/
xmlDictPtr
xmlDictCreateSub(xmlDictPtr sub) {
xmlDictPtr dict = xmlDictCreate();
if ((dict != NULL) && (sub != NULL)) {
dict->subdict = sub;
xmlDictReference(dict->subdict);
}
return(dict);
}
/**
* xmlDictReference:
* @dict: the dictionnary
*
* Increment the reference counter of a dictionary
*
* Returns 0 in case of success and -1 in case of error
*/
int
xmlDictReference(xmlDictPtr dict) {
if (!xmlDictInitialized)
if (!xmlInitializeDict())
return(-1);
if (dict == NULL) return -1;
xmlRMutexLock(xmlDictMutex);
dict->ref_counter++;
xmlRMutexUnlock(xmlDictMutex);
return(0);
}
/**
* xmlDictGrow:
* @dict: the dictionnary
* @size: the new size of the dictionnary
*
* resize the dictionnary
*
* Returns 0 in case of success, -1 in case of failure
*/
static int
xmlDictGrow(xmlDictPtr dict, int size) {
unsigned long key;
int oldsize, i;
xmlDictEntryPtr iter, next;
struct _xmlDictEntry *olddict;
#ifdef DEBUG_GROW
unsigned long nbElem = 0;
#endif
if (dict == NULL)
return(-1);
if (size < 8)
return(-1);
if (size > 8 * 2048)
return(-1);
oldsize = dict->size;
olddict = dict->dict;
if (olddict == NULL)
return(-1);
dict->dict = xmlMalloc(size * sizeof(xmlDictEntry));
if (dict->dict == NULL) {
dict->dict = olddict;
return(-1);
}
memset(dict->dict, 0, size * sizeof(xmlDictEntry));
dict->size = size;
/* If the two loops are merged, there would be situations where
a new entry needs to allocated and data copied into it from
the main dict. So instead, we run through the array twice, first
copying all the elements in the main array (where we can't get
conflicts) and then the rest, so we only free (and don't allocate)
*/
for (i = 0; i < oldsize; i++) {
if (olddict[i].valid == 0)
continue;
key = xmlDictComputeKey(olddict[i].name, olddict[i].len) % dict->size;
memcpy(&(dict->dict[key]), &(olddict[i]), sizeof(xmlDictEntry));
dict->dict[key].next = NULL;
#ifdef DEBUG_GROW
nbElem++;
#endif
}
for (i = 0; i < oldsize; i++) {
iter = olddict[i].next;
while (iter) {
next = iter->next;
/*
* put back the entry in the new dict
*/
key = xmlDictComputeKey(iter->name, iter->len) % dict->size;
if (dict->dict[key].valid == 0) {
memcpy(&(dict->dict[key]), iter, sizeof(xmlDictEntry));
dict->dict[key].next = NULL;
dict->dict[key].valid = 1;
xmlFree(iter);
} else {
iter->next = dict->dict[key].next;
dict->dict[key].next = iter;
}
#ifdef DEBUG_GROW
nbElem++;
#endif
iter = next;
}
}
xmlFree(olddict);
#ifdef DEBUG_GROW
xmlGenericError(xmlGenericErrorContext,
"xmlDictGrow : from %d to %d, %d elems\n", oldsize, size, nbElem);
#endif
return(0);
}
/**
* xmlDictFree:
* @dict: the dictionnary
*
* Free the hash @dict and its contents. The userdata is
* deallocated with @f if provided.
*/
void
xmlDictFree(xmlDictPtr dict) {
int i;
xmlDictEntryPtr iter;
xmlDictEntryPtr next;
int inside_dict = 0;
xmlDictStringsPtr pool, nextp;
if (dict == NULL)
return;
if (!xmlDictInitialized)
if (!xmlInitializeDict())
return;
/* decrement the counter, it may be shared by a parser and docs */
xmlRMutexLock(xmlDictMutex);
dict->ref_counter--;
if (dict->ref_counter > 0) {
xmlRMutexUnlock(xmlDictMutex);
return;
}
xmlRMutexUnlock(xmlDictMutex);
if (dict->subdict != NULL) {
xmlDictFree(dict->subdict);
}
if (dict->dict) {
for(i = 0; ((i < dict->size) && (dict->nbElems > 0)); i++) {
iter = &(dict->dict[i]);
if (iter->valid == 0)
continue;
inside_dict = 1;
while (iter) {
next = iter->next;
if (!inside_dict)
xmlFree(iter);
dict->nbElems--;
inside_dict = 0;
iter = next;
}
inside_dict = 0;
}
xmlFree(dict->dict);
}
pool = dict->strings;
while (pool != NULL) {
nextp = pool->next;
xmlFree(pool);
pool = nextp;
}
xmlFreeRMutex(dict->mutex);
xmlFree(dict);
}
/**
* xmlDictLookup:
* @dict: the dictionnary
* @name: the name of the userdata
* @len: the length of the name, if -1 it is recomputed
*
* Add the @name to the dictionnary @dict if not present.
*
* Returns the internal copy of the name or NULL in case of internal error
*/
const xmlChar *
xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) {
unsigned long key, okey, nbi = 0;
xmlDictEntryPtr entry;
xmlDictEntryPtr insert;
const xmlChar *ret;
if ((dict == NULL) || (name == NULL))
return(NULL);
if (len < 0)
len = xmlStrlen(name);
/*
* Check for duplicate and insertion location.
*/
okey = xmlDictComputeKey(name, len);
key = okey % dict->size;
if (dict->dict[key].valid == 0) {
insert = NULL;
} else {
for (insert = &(dict->dict[key]); insert->next != NULL;
insert = insert->next) {
#ifdef __GNUC__
if (insert->len == len) {
if (!memcmp(insert->name, name, len))
return(insert->name);
}
#else
if ((insert->len == len) &&
(!xmlStrncmp(insert->name, name, len)))
return(insert->name);
#endif
nbi++;
}
#ifdef __GNUC__
if (insert->len == len) {
if (!memcmp(insert->name, name, len))
return(insert->name);
}
#else
if ((insert->len == len) &&
(!xmlStrncmp(insert->name, name, len)))
return(insert->name);
#endif
}
if (dict->subdict) {
key = okey % dict->subdict->size;
if (dict->subdict->dict[key].valid != 0) {
xmlDictEntryPtr tmp;
for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL;
tmp = tmp->next) {
#ifdef __GNUC__
if (tmp->len == len) {
if (!memcmp(tmp->name, name, len))
return(tmp->name);
}
#else
if ((tmp->len == len) &&
(!xmlStrncmp(tmp->name, name, len)))
return(tmp->name);
#endif
nbi++;
}
#ifdef __GNUC__
if (tmp->len == len) {
if (!memcmp(tmp->name, name, len))
return(tmp->name);
}
#else
if ((tmp->len == len) &&
(!xmlStrncmp(tmp->name, name, len)))
return(tmp->name);
#endif
}
key = okey % dict->size;
}
ret = xmlDictAddString(dict, name, len);
if (ret == NULL)
return(NULL);
if (insert == NULL) {
entry = &(dict->dict[key]);
} else {
entry = xmlMalloc(sizeof(xmlDictEntry));
if (entry == NULL)
return(NULL);
}
entry->name = ret;
entry->len = len;
entry->next = NULL;
entry->valid = 1;
if (insert != NULL)
insert->next = entry;
dict->nbElems++;
if ((nbi > MAX_HASH_LEN) &&
(dict->size <= ((MAX_DICT_HASH / 2) / MAX_HASH_LEN)))
xmlDictGrow(dict, MAX_HASH_LEN * 2 * dict->size);
/* Note that entry may have been freed at this point by xmlDictGrow */
return(ret);
}
/**
* xmlDictExists:
* @dict: the dictionnary
* @name: the name of the userdata
* @len: the length of the name, if -1 it is recomputed
*
* Check if the @name exists in the dictionnary @dict.
*
* Returns the internal copy of the name or NULL if not found.
*/
const xmlChar *
xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) {
unsigned long key, okey, nbi = 0;
xmlDictEntryPtr insert;
if ((dict == NULL) || (name == NULL))
return(NULL);
if (len < 0)
len = xmlStrlen(name);
/*
* Check for duplicate and insertion location.
*/
okey = xmlDictComputeKey(name, len);
key = okey % dict->size;
if (dict->dict[key].valid == 0) {
insert = NULL;
} else {
for (insert = &(dict->dict[key]); insert->next != NULL;
insert = insert->next) {
#ifdef __GNUC__
if (insert->len == len) {
if (!memcmp(insert->name, name, len))
return(insert->name);
}
#else
if ((insert->len == len) &&
(!xmlStrncmp(insert->name, name, len)))
return(insert->name);
#endif
nbi++;
}
#ifdef __GNUC__
if (insert->len == len) {
if (!memcmp(insert->name, name, len))
return(insert->name);
}
#else
if ((insert->len == len) &&
(!xmlStrncmp(insert->name, name, len)))
return(insert->name);
#endif
}
if (dict->subdict) {
key = okey % dict->subdict->size;
if (dict->subdict->dict[key].valid != 0) {
xmlDictEntryPtr tmp;
for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL;
tmp = tmp->next) {
#ifdef __GNUC__
if (tmp->len == len) {
if (!memcmp(tmp->name, name, len))
return(tmp->name);
}
#else
if ((tmp->len == len) &&
(!xmlStrncmp(tmp->name, name, len)))
return(tmp->name);
#endif
nbi++;
}
#ifdef __GNUC__
if (tmp->len == len) {
if (!memcmp(tmp->name, name, len))
return(tmp->name);
}
#else
if ((tmp->len == len) &&
(!xmlStrncmp(tmp->name, name, len)))
return(tmp->name);
#endif
}
key = okey % dict->size;
}
/* not found */
return(NULL);
}
/**
* xmlDictQLookup:
* @dict: the dictionnary
* @prefix: the prefix
* @name: the name
*
* Add the QName @prefix:@name to the hash @dict if not present.
*
* Returns the internal copy of the QName or NULL in case of internal error
*/
const xmlChar *
xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name) {
unsigned long okey, key, nbi = 0;
xmlDictEntryPtr entry;
xmlDictEntryPtr insert;
const xmlChar *ret;
int len;
if ((dict == NULL) || (name == NULL))
return(NULL);
len = xmlStrlen(name);
if (prefix != NULL)
len += 1 + xmlStrlen(prefix);
/*
* Check for duplicate and insertion location.
*/
okey = xmlDictComputeQKey(prefix, name, len);
key = okey % dict->size;
if (dict->dict[key].valid == 0) {
insert = NULL;
} else {
for (insert = &(dict->dict[key]); insert->next != NULL;
insert = insert->next) {
if ((insert->len == len) &&
(xmlStrQEqual(prefix, name, insert->name)))
return(insert->name);
nbi++;
}
if ((insert->len == len) &&
(xmlStrQEqual(prefix, name, insert->name)))
return(insert->name);
}
if (dict->subdict) {
key = okey % dict->subdict->size;
if (dict->subdict->dict[key].valid != 0) {
xmlDictEntryPtr tmp;
for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL;
tmp = tmp->next) {
if ((tmp->len == len) &&
(xmlStrQEqual(prefix, name, tmp->name)))
return(tmp->name);
nbi++;
}
if ((tmp->len == len) &&
(xmlStrQEqual(prefix, name, tmp->name)))
return(tmp->name);
}
key = okey % dict->size;
}
ret = xmlDictAddQString(dict, prefix, name, len);
if (ret == NULL)
return(NULL);
if (insert == NULL) {
entry = &(dict->dict[key]);
} else {
entry = xmlMalloc(sizeof(xmlDictEntry));
if (entry == NULL)
return(NULL);
}
entry->name = ret;
entry->len = len;
entry->next = NULL;
entry->valid = 1;
if (insert != NULL)
insert->next = entry;
dict->nbElems++;
if ((nbi > MAX_HASH_LEN) &&
(dict->size <= ((MAX_DICT_HASH / 2) / MAX_HASH_LEN)))
xmlDictGrow(dict, MAX_HASH_LEN * 2 * dict->size);
/* Note that entry may have been freed at this point by xmlDictGrow */
return(ret);
}
/**
* xmlDictOwns:
* @dict: the dictionnary
* @str: the string
*
* check if a string is owned by the disctionary
*
* Returns 1 if true, 0 if false and -1 in case of error
* -1 in case of error
*/
int
xmlDictOwns(xmlDictPtr dict, const xmlChar *str) {
xmlDictStringsPtr pool;
if ((dict == NULL) || (str == NULL))
return(-1);
pool = dict->strings;
while (pool != NULL) {
if ((str >= &pool->array[0]) && (str <= pool->free))
return(1);
pool = pool->next;
}
if (dict->subdict)
return(xmlDictOwns(dict->subdict, str));
return(0);
}
/**
* xmlDictSize:
* @dict: the dictionnary
*
* Query the number of elements installed in the hash @dict.
*
* Returns the number of elements in the dictionnary or
* -1 in case of error
*/
int
xmlDictSize(xmlDictPtr dict) {
if (dict == NULL)
return(-1);
if (dict->subdict)
return(dict->nbElems + dict->subdict->nbElems);
return(dict->nbElems);
}
#define bottom_dict
#include "elfgcchack.h"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,117 @@
<?xml version="1.0"?>
<!-- this stylesheet builds the ChangeLog.html -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Import the rest of the site stylesheets -->
<xsl:import href="site.xsl"/>
<!-- Generate XHTML-1.0 transitional -->
<xsl:output method="xml" encoding="ISO-8859-1" indent="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:param name="module">libxml2</xsl:param>
<!-- The table of content for the HTML page -->
<xsl:variable name="menu_name">API Menu</xsl:variable>
<xsl:variable name="develtoc">
<form action="../search.php"
enctype="application/x-www-form-urlencoded" method="get">
<input name="query" type="text" size="20" value=""/>
<input name="submit" type="submit" value="Search ..."/>
</form>
<ul><!-- style="margin-left: -1em" -->
<li><a style="font-weight:bold"
href="{$href_base}index.html">Main Menu</a></li>
<li><a style="font-weight:bold"
href="{$href_base}docs.html">Developer Menu</a></li>
<li><a style="font-weight:bold"
href="{$href_base}html/index.html">Modules Index</a></li>
<li><a style="font-weight:bold"
href="{$href_base}examples/index.html">Code Examples</a></li>
<li><a style="font-weight:bold"
href="index.html">API Menu</a></li>
<li><a href="html/libxml-parser.html">Parser API</a></li>
<li><a href="html/libxml-tree.html">Tree API</a></li>
<li><a href="html/libxml-xmlreader.html">Reader API</a></li>
<li><a href="{$href_base}guidelines.html">XML Guidelines</a></li>
</ul>
</xsl:variable>
<xsl:template match="bug">
<a href="http://bugzilla.gnome.org/show_bug.cgi?id={@number}">
<xsl:value-of select="@number"/></a>
</xsl:template>
<xsl:template match="item">
<li><xsl:apply-templates/></li>
</xsl:template>
<xsl:template match="entry">
<p>
<b><xsl:value-of select="@who"/></b>
<xsl:text> </xsl:text>
<xsl:value-of select="@date"/>
<xsl:text> </xsl:text>
<xsl:value-of select="@timezone"/>
<ul>
<xsl:apply-templates select="item"/>
</ul>
</p>
</xsl:template>
<xsl:template match="log">
<xsl:variable name="title">ChangeLog last entries of <xsl:value-of select="$module"/></xsl:variable>
<html>
<head>
<xsl:call-template name="style"/>
<xsl:element name="title">
<xsl:value-of select="$title"/>
</xsl:element>
</head>
<body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
<xsl:call-template name="titlebox">
<xsl:with-param name="title" select="$title"/>
</xsl:call-template>
<table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
<tr>
<td bgcolor="#8b7765">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td valign="top" width="200" bgcolor="#8b7765">
<xsl:call-template name="develtoc"/>
</td>
<td valign="top" bgcolor="#8b7765">
<table border="0" cellspacing="0" cellpadding="1" width="100%">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="1" width="100%">
<tr>
<td bgcolor="#fffacd">
<xsl:apply-templates select="entry"/>
<p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,279 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css">
TD {font-family: Verdana,Arial,Helvetica}
BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
H1 {font-family: Verdana,Arial,Helvetica}
H2 {font-family: Verdana,Arial,Helvetica}
H3 {font-family: Verdana,Arial,Helvetica}
A:link, A:visited, A:active { text-decoration: underline }
</style><title>FAQ</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1>The XML C parser and toolkit of Gnome</h1><h2>FAQ</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Main Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a href="index.html">Home</a></li><li><a href="http://xmlsoft.org/wiki">Wiki</a></li><li><a href="html/index.html">Reference Manual</a></li><li><a href="intro.html">Introduction</a></li><li><a href="FAQ.html">FAQ</a></li><li><a href="docs.html" style="font-weight:bold">Developer Menu</a></li><li><a href="bugs.html">Reporting bugs and getting help</a></li><li><a href="help.html">How to help</a></li><li><a href="downloads.html">Downloads</a></li><li><a href="news.html">Releases</a></li><li><a href="XMLinfo.html">XML</a></li><li><a href="XSLT.html">XSLT</a></li><li><a href="xmldtd.html">Validation &amp; DTDs</a></li><li><a href="encoding.html">Encodings support</a></li><li><a href="catalog.html">Catalog support</a></li><li><a href="namespaces.html">Namespaces</a></li><li><a href="contribs.html">Contributions</a></li><li><a href="examples/index.html" style="font-weight:bold">Code Examples</a></li><li><a href="html/index.html" style="font-weight:bold">API Menu</a></li><li><a href="guidelines.html">XML Guidelines</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://www.blastwave.org/packages.php/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://rubyforge.org/projects/xml-tools/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><p>Table of Contents:</p><ul><li><a href="FAQ.html#License">License(s)</a></li>
<li><a href="FAQ.html#Installati">Installation</a></li>
<li><a href="FAQ.html#Compilatio">Compilation</a></li>
<li><a href="FAQ.html#Developer">Developer corner</a></li>
</ul><h3><a name="License" id="License">License</a>(s)</h3><ol><li><em>Licensing Terms for libxml</em>
<p>libxml2 is released under the <a href="http://www.opensource.org/licenses/mit-license.html">MIT
License</a>; see the file Copyright in the distribution for the precise
wording</p>
</li>
<li><em>Can I embed libxml2 in a proprietary application ?</em>
<p>Yes. The MIT License allows you to keep proprietary the changes you
made to libxml, but it would be graceful to send-back bug fixes and
improvements as patches for possible incorporation in the main
development tree.</p>
</li>
</ol><h3><a name="Installati" id="Installati">Installation</a></h3><ol><li><strong><span style="background-color: #FF0000">Do Not Use
libxml1</span></strong>, use libxml2</li>
<li><em>Where can I get libxml</em> ?
<p>The original distribution comes from <a href="ftp://rpmfind.net/pub/libxml/">rpmfind.net</a> or <a href="ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/">gnome.org</a></p>
<p>Most Linux and BSD distributions include libxml, this is probably the
safer way for end-users to use libxml.</p>
<p>David Doolin provides precompiled Windows versions at <a href="http://www.ce.berkeley.edu/~doolin/code/libxmlwin32/ ">http://www.ce.berkeley.edu/~doolin/code/libxmlwin32/</a></p>
</li>
<li><em>I see libxml and libxml2 releases, which one should I install ?</em>
<ul><li>If you are not constrained by backward compatibility issues with
existing applications, install libxml2 only</li>
<li>If you are not doing development, you can safely install both.
Usually the packages <a href="http://rpmfind.net/linux/RPM/libxml.html">libxml</a> and <a href="http://rpmfind.net/linux/RPM/libxml2.html">libxml2</a> are
compatible (this is not the case for development packages).</li>
<li>If you are a developer and your system provides separate packaging
for shared libraries and the development components, it is possible
to install libxml and libxml2, and also <a href="http://rpmfind.net/linux/RPM/libxml-devel.html">libxml-devel</a>
and <a href="http://rpmfind.net/linux/RPM/libxml2-devel.html">libxml2-devel</a>
too for libxml2 &gt;= 2.3.0</li>
<li>If you are developing a new application, please develop against
libxml2(-devel)</li>
</ul></li>
<li><em>I can't install the libxml package, it conflicts with libxml0</em>
<p>You probably have an old libxml0 package used to provide the shared
library for libxml.so.0, you can probably safely remove it. The libxml
packages provided on <a href="ftp://rpmfind.net/pub/libxml/">rpmfind.net</a> provide
libxml.so.0</p>
</li>
<li><em>I can't install the libxml(2) RPM package due to failed
dependencies</em>
<p>The most generic solution is to re-fetch the latest src.rpm , and
rebuild it locally with</p>
<p><code>rpm --rebuild libxml(2)-xxx.src.rpm</code>.</p>
<p>If everything goes well it will generate two binary rpm packages (one
providing the shared libs and xmllint, and the other one, the -devel
package, providing includes, static libraries and scripts needed to build
applications with libxml(2)) that you can install locally.</p>
</li>
</ol><h3><a name="Compilatio" id="Compilatio">Compilation</a></h3><ol><li><em>What is the process to compile libxml2 ?</em>
<p>As most UNIX libraries libxml2 follows the "standard":</p>
<p><code>gunzip -c xxx.tar.gz | tar xvf -</code></p>
<p><code>cd libxml-xxxx</code></p>
<p><code>./configure --help</code></p>
<p>to see the options, then the compilation/installation proper</p>
<p><code>./configure [possible options]</code></p>
<p><code>make</code></p>
<p><code>make install</code></p>
<p>At that point you may have to rerun ldconfig or a similar utility to
update your list of installed shared libs.</p>
</li>
<li><em>What other libraries are needed to compile/install libxml2 ?</em>
<p>Libxml2 does not require any other library, the normal C ANSI API
should be sufficient (please report any violation to this rule you may
find).</p>
<p>However if found at configuration time libxml2 will detect and use the
following libs:</p>
<ul><li><a href="http://www.info-zip.org/pub/infozip/zlib/">libz</a> : a
highly portable and available widely compression library.</li>
<li>iconv: a powerful character encoding conversion library. It is
included by default in recent glibc libraries, so it doesn't need to
be installed specifically on Linux. It now seems a <a href="http://www.opennc.org/onlinepubs/7908799/xsh/iconv.html">part
of the official UNIX</a> specification. Here is one <a href="http://www.gnu.org/software/libiconv/">implementation of the
library</a> which source can be found <a href="ftp://ftp.ilog.fr/pub/Users/haible/gnu/">here</a>.</li>
</ul></li>
<li><em>Make check fails on some platforms</em>
<p>Sometimes the regression tests' results don't completely match the
value produced by the parser, and the makefile uses diff to print the
delta. On some platforms the diff return breaks the compilation process;
if the diff is small this is probably not a serious problem.</p>
<p>Sometimes (especially on Solaris) make checks fail due to limitations
in make. Try using GNU-make instead.</p>
</li>
<li><em>I use the CVS version and there is no configure script</em>
<p>The configure script (and other Makefiles) are generated. Use the
autogen.sh script to regenerate the configure script and Makefiles,
like:</p>
<p><code>./autogen.sh --prefix=/usr --disable-shared</code></p>
</li>
<li><em>I have troubles when running make tests with gcc-3.0</em>
<p>It seems the initial release of gcc-3.0 has a problem with the
optimizer which miscompiles the URI module. Please use another
compiler.</p>
</li>
</ol><h3><a name="Developer" id="Developer">Developer</a> corner</h3><ol><li><em>Troubles compiling or linking programs using libxml2</em>
<p>Usually the problem comes from the fact that the compiler doesn't get
the right compilation or linking flags. There is a small shell script
<code>xml2-config</code> which is installed as part of libxml2 usual
install process which provides those flags. Use</p>
<p><code>xml2-config --cflags</code></p>
<p>to get the compilation flags and</p>
<p><code>xml2-config --libs</code></p>
<p>to get the linker flags. Usually this is done directly from the
Makefile as:</p>
<p><code>CFLAGS=`xml2-config --cflags`</code></p>
<p><code>LIBS=`xml2-config --libs`</code></p>
</li>
<li><em>I want to install my own copy of libxml2 in my home directory and link
my programs against it, but it doesn't work</em>
<p>There are many different ways to accomplish this. Here is one way to
do this under Linux. Suppose your home directory is <code>/home/user.
</code>Then:</p>
<ul><li>Create a subdirectory, let's call it <code>myxml</code></li>
<li>unpack the libxml2 distribution into that subdirectory</li>
<li>chdir into the unpacked distribution (<code>/home/user/myxml/libxml2
</code>)</li>
<li>configure the library using the "<code>--prefix</code>" switch,
specifying an installation subdirectory in <code>/home/user/myxml</code>,
e.g.
<p><code>./configure --prefix /home/user/myxml/xmlinst</code> {other
configuration options}</p></li>
<li>now run <code>make</code> followed by <code>make install</code></li>
<li>At this point, the installation subdirectory contains the complete
"private" include files, library files and binary program files (e.g.
xmllint), located in
<p> <code>/home/user/myxml/xmlinst/lib, /home/user/myxml/xmlinst/include
</code> and <code> /home/user/myxml/xmlinst/bin</code></p>
respectively.</li>
<li>In order to use this "private" library, you should first add it
to the beginning of your default PATH (so that your own private
program files such as xmllint will be used instead of the normal
system ones). To do this, the Bash command would be
<p><code>export PATH=/home/user/myxml/xmlinst/bin:$PATH</code></p></li>
<li>Now suppose you have a program <code>test1.c</code> that you would
like to compile with your "private" library. Simply compile it
using the command <p><code>gcc `xml2-config --cflags --libs` -o test
test.c</code></p> Note that, because your PATH has been set with <code>
/home/user/myxml/xmlinst/bin</code> at the beginning, the
xml2-config program which you just installed will be used instead of
the system default one, and this will <em>automatically</em> get the
correct libraries linked with your program.</li></ul></li><p></p>
<li><em>xmlDocDump() generates output on one line.</em>
<p>Libxml2 will not <strong>invent</strong> spaces in the content of a
document since <strong>all spaces in the content of a document are
significant</strong>. If you build a tree from the API and want
indentation:</p>
<ol><li>the correct way is to generate those yourself too.</li>
<li>the dangerous way is to ask libxml2 to add those blanks to your
content <strong>modifying the content of your document in the
process</strong>. The result may not be what you expect. There is
<strong>NO</strong> way to guarantee that such a modification won't
affect other parts of the content of your document. See <a href="http://xmlsoft.org/html/libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault
()</a> and <a href="http://xmlsoft.org/html/libxml-tree.html#xmlSaveFormatFile">xmlSaveFormatFile
()</a></li>
</ol></li>
<li>Extra nodes in the document:
<p><em>For a XML file as below:</em></p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;PLAN xmlns="http://www.argus.ca/autotest/1.0/"&gt;
&lt;NODE CommFlag="0"/&gt;
&lt;NODE CommFlag="1"/&gt;
&lt;/PLAN&gt;</pre>
<p><em>after parsing it with the function
pxmlDoc=xmlParseFile(...);</em></p>
<p><em>I want to the get the content of the first node (node with the
CommFlag="0")</em></p>
<p><em>so I did it as following;</em></p>
<pre>xmlNodePtr pnode;
pnode=pxmlDoc-&gt;children-&gt;children;</pre>
<p><em>but it does not work. If I change it to</em></p>
<pre>pnode=pxmlDoc-&gt;children-&gt;children-&gt;next;</pre>
<p><em>then it works. Can someone explain it to me.</em></p>
<p></p>
<p>In XML all characters in the content of the document are significant
<strong>including blanks and formatting line breaks</strong>.</p>
<p>The extra nodes you are wondering about are just that, text nodes with
the formatting spaces which are part of the document but that people tend
to forget. There is a function <a href="http://xmlsoft.org/html/libxml-parser.html">xmlKeepBlanksDefault
()</a> to remove those at parse time, but that's an heuristic, and its
use should be limited to cases where you are certain there is no
mixed-content in the document.</p>
</li>
<li><em>I get compilation errors of existing code like when accessing
<strong>root</strong> or <strong>child fields</strong> of nodes.</em>
<p>You are compiling code developed for libxml version 1 and using a
libxml2 development environment. Either switch back to libxml v1 devel or
even better fix the code to compile with libxml2 (or both) by <a href="upgrade.html">following the instructions</a>.</p>
</li>
<li><em>I get compilation errors about non existing
<strong>xmlRootNode</strong> or <strong>xmlChildrenNode</strong>
fields.</em>
<p>The source code you are using has been <a href="upgrade.html">upgraded</a> to be able to compile with both libxml
and libxml2, but you need to install a more recent version:
libxml(-devel) &gt;= 1.8.8 or libxml2(-devel) &gt;= 2.1.0</p>
</li>
<li><em>XPath implementation looks seriously broken</em>
<p>XPath implementation prior to 2.3.0 was really incomplete. Upgrade to
a recent version, there are no known bugs in the current version.</p>
</li>
<li><em>The example provided in the web page does not compile.</em>
<p>It's hard to maintain the documentation in sync with the code
&lt;grin/&gt; ...</p>
<p>Check the previous points 1/ and 2/ raised before, and please send
patches.</p>
</li>
<li><em>Where can I get more examples and information than provided on the
web page?</em>
<p>Ideally a libxml2 book would be nice. I have no such plan ... But you
can:</p>
<ul><li>check more deeply the <a href="html/libxml-lib.html">existing
generated doc</a></li>
<li>have a look at <a href="examples/index.html">the set of
examples</a>.</li>
<li>look for examples of use for libxml2 function using the Gnome code.
For example the following will query the full Gnome CVS base for the
use of the <strong>xmlAddChild()</strong> function:
<p><a href="http://cvs.gnome.org/lxr/search?string=xmlAddChild">http://cvs.gnome.org/lxr/search?string=xmlAddChild</a></p>
<p>This may be slow, a large hardware donation to the gnome project
could cure this :-)</p>
</li>
<li><a href="http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnome&amp;dir=gnome-xml">Browse
the libxml2 source</a> , I try to write code as clean and documented
as possible, so looking at it may be helpful. In particular the code
of xmllint.c and of the various testXXX.c test programs should
provide good examples of how to do things with the library.</li>
</ul></li>
<li>What about C++ ?
<p>libxml2 is written in pure C in order to allow easy reuse on a number
of platforms, including embedded systems. I don't intend to convert to
C++.</p>
<p>There is however a C++ wrapper which may fulfill your needs:</p>
<ul><li>by Ari Johnson &lt;ari@btigate.com&gt;:
<p>Website: <a href="http://libxmlplusplus.sourceforge.net/">http://libxmlplusplus.sourceforge.net/</a></p>
<p>Download: <a href="http://sourceforge.net/project/showfiles.php?group_id=12999">http://sourceforge.net/project/showfiles.php?group_id=12999</a></p>
</li>
<!-- Website is currently unavailable as of 2003-08-02
<li>by Peter Jones &lt;pjones@pmade.org&gt;
<p>Website: <a
href="http://pmade.org/pjones/software/xmlwrapp/">http://pmade.org/pjones/software/xmlwrapp/</a></p>
</li>
-->
</ul></li>
<li>How to validate a document a posteriori ?
<p>It is possible to validate documents which had not been validated at
initial parsing time or documents which have been built from scratch
using the API. Use the <a href="http://xmlsoft.org/html/libxml-valid.html#xmlValidateDtd">xmlValidateDtd()</a>
function. It is also possible to simply add a DTD to an existing
document:</p>
<pre>xmlDocPtr doc; /* your existing document */
xmlDtdPtr dtd = xmlParseDTD(NULL, filename_of_dtd); /* parse the DTD */
dtd-&gt;name = xmlStrDup((xmlChar*)"root_name"); /* use the given root */
doc-&gt;intSubset = dtd;
if (doc-&gt;children == NULL) xmlAddChild((xmlNodePtr)doc, (xmlNodePtr)dtd);
else xmlAddPrevSibling(doc-&gt;children, (xmlNodePtr)dtd);
</pre>
</li>
<li>So what is this funky "xmlChar" used all the time?
<p>It is a null terminated sequence of utf-8 characters. And only utf-8!
You need to convert strings encoded in different ways to utf-8 before
passing them to the API. This can be accomplished with the iconv library
for instance.</p>
</li>
<li>etc ...</li>
</ol><p></p><p><a href="bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

View file

@ -0,0 +1,124 @@
## Process this file with automake to produce Makefile.in
SUBDIRS=examples
# The top-level SGML file.
DOC_MAIN_XML_FILE=gnome-xml.xml
# The directory containing the source code (if it contains documentation).
DOC_SOURCE_DIR=..
# A file in win32 depends upon one of the doc files
WIN32_DIR=$(top_srcdir)/win32
PAGES= architecture.html bugs.html contribs.html docs.html DOM.html \
downloads.html entities.html example.html help.html index.html \
interface.html intro.html library.html namespaces.html news.html \
tree.html xmldtd.html XMLinfo.html XSLT.html
APIPAGES=APIconstructors.html APIfiles.html APIfunctions.html \
APIsymbols.html APIchunk0.html
EXTRA_DIST=xmlcatalog_man.xml tutorial/*.html tutorial/*.c tutorial/*.pdf \
tutorial/images/*.png tutorial/images/callouts/*.png \
API*.html *.1 *.xsl *.html *.gif w3c.png html/*.html \
html/*.png libxml2-api.xml index.py search.php \
apibuild.py libxml2.xsa xmllint.xml xmlcatalog_man.xml \
README.docs
man_MANS = xmllint.1 xmlcatalog.1
all: web $(top_builddir)/NEWS libxml2.xsa $(man_MANS)
api: libxml2-api.xml libxml2-refs.xml $(APIPAGES) $(srcdir)/html/index.html $(WIN32_DIR)/libxml2.def.src ../elfgcchack.h
web: $(PAGES)
../elfgcchack.h: $(srcdir)/elfgcchack.xsl $(srcdir)/libxml2-api.xml
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the elfgcchack.h header" ; \
$(XSLTPROC) --nonet $(srcdir)/elfgcchack.xsl $(srcdir)/libxml2-api.xml > elfgcchack.h ; \
if [ "`diff -q elfgcchack.h ../elfgcchack.h`" ] ; then \
echo "updating ../elfgcchack.h"; \
cp elfgcchack.h ../elfgcchack.h; \
fi ; rm -f elfgcchack.h ; fi );
$(PAGES): xml.html site.xsl
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the HTML Web pages from xml.html" ; \
$(XSLTPROC) --nonet --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/xml.html > index.html ; fi );
-@(if [ -x $(XMLLINT) ] ; then \
echo "Validating the HTML Web pages" ; \
$(XMLLINT) --nonet --valid --noout $(PAGES) ; fi );
$(top_builddir)/NEWS: $(top_srcdir)/doc/news.xsl $(top_srcdir)/doc/news.html
-@(if [ -x $(XSLTPROC) ] ; then \
$(XSLTPROC) --nonet $(top_srcdir)/doc/news.xsl $(top_srcdir)/doc/news.html > $(top_builddir)/NEWS ; fi );
libxml2.xsa: $(top_srcdir)/doc/xsa.xsl $(top_srcdir)/doc/news.html
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the NEWS file" ; \
$(XSLTPROC) --nonet $(top_srcdir)/doc/xsa.xsl $(top_srcdir)/doc/news.html > libxml2.xsa ; fi );
$(APIPAGES): libxml2-api.xml libxml2-refs.xml $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/api.xsl
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the HTML API pages from libxml2-refs.xml" ; \
$(XSLTPROC) --nonet --html $(top_srcdir)/doc/api.xsl \
$(top_srcdir)/doc/xml.html ; fi );
-@(if [ -x $(XMLLINT) ] ; then \
echo "Validating the HTML API pages" ; \
$(XMLLINT) --nonet --valid --noout API*.html ; fi );
$(srcdir)/html/index.html: libxml2-api.xml $(srcdir)/newapi.xsl
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the HTML pages from the XML API" ; \
$(XSLTPROC) --nonet $(srcdir)/newapi.xsl libxml2-api.xml ; fi )
-@(if [ -x $(XMLLINT) ] ; then \
echo "Validating the resulting XHTML pages" ; \
$(XMLLINT) --nonet --valid --noout html/*.html ; fi );
wiki: libxml2-api.xml $(srcdir)/wiki.xsl
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the wiki HTML pages from the XML API" ; \
$(XSLTPROC) --nonet $(srcdir)/wiki.xsl libxml2-api.xml; fi )
$(WIN32_DIR)/libxml2.def.src: libxml2-api.xml
-@(if [ -x $(XSLTPROC) ] ; then \
$(XSLTPROC) -o $(WIN32_DIR)/libxml2.def.src \
--nonet $(WIN32_DIR)/defgen.xsl libxml2-api.xml ; fi )
libxml2-api.xml libxml2-refs.xml: apibuild.py ../include/libxml/*.h ../*.c
-(./apibuild.py)
-@(cd .. ; $(MAKE) rebuild_testapi)
xmllint.1: xmllint.xml
-@($(XSLTPROC) --nonet xmllint.xml)
xmlcatalog.1: xmlcatalog_man.xml
-@($(XSLTPROC) --nonet xmlcatalog_man.xml)
clean-local:
rm -f *~ *.bak *.hierarchy *.signals *-unused.txt
maintainer-clean-local: clean-local
rm -rf libxml-decl-list.txt libxml-decl.txt
rebuild: api all
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
-@INSTALL@ -m 0644 $(srcdir)/xml.html $(srcdir)/encoding.html $(srcdir)/FAQ.html $(srcdir)/structure.gif $(srcdir)/DOM.gif $(srcdir)/smallfootonly.gif $(srcdir)/redhat.gif $(srcdir)/libxml.gif $(srcdir)/w3c.png $(srcdir)/Libxml2-Logo-180x168.gif $(srcdir)/Libxml2-Logo-90x34.gif $(DESTDIR)$(HTML_DIR)
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html
-@INSTALL@ -m 0644 $(srcdir)/html/*.html $(DESTDIR)$(HTML_DIR)/html
-@INSTALL@ -m 0644 $(srcdir)/html/*.png $(DESTDIR)$(HTML_DIR)/html
-@INSTALL@ -m 0644 $(srcdir)/html/index.sgml $(DESTDIR)$(HTML_DIR)/html
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/tutorial
-@INSTALL@ -m 0644 $(srcdir)/tutorial/*.* \
$(DESTDIR)$(HTML_DIR)/tutorial
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/tutorial/images
-@INSTALL@ -m 0644 $(srcdir)/tutorial/images/*.* \
$(DESTDIR)$(HTML_DIR)/tutorial/images
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/tutorial/images/callouts
-@INSTALL@ -m 0644 $(srcdir)/tutorial/images/callouts/*.* \
$(DESTDIR)$(HTML_DIR)/tutorial/images/callouts
.PHONY : html xml templates scan

View file

@ -0,0 +1,746 @@
# Makefile.in generated by automake 1.9.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = doc
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
install-recursive installcheck-recursive installdirs-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \
uninstall-recursive
man1dir = $(mandir)/man1
am__installdirs = "$(DESTDIR)$(man1dir)"
NROFF = nroff
MANS = $(man_MANS)
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_THREAD_LIBS = @BASE_THREAD_LIBS@
C14N_OBJ = @C14N_OBJ@
CATALOG_OBJ = @CATALOG_OBJ@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@
CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@
DEBUG_OBJ = @DEBUG_OBJ@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCB_OBJ = @DOCB_OBJ@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FTP_OBJ = @FTP_OBJ@
HAVE_ISINF = @HAVE_ISINF@
HAVE_ISNAN = @HAVE_ISNAN@
HTML_DIR = @HTML_DIR@
HTML_OBJ = @HTML_OBJ@
HTTP_OBJ = @HTTP_OBJ@
ICONV_LIBS = @ICONV_LIBS@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@
LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@
LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@
LIBXML_VERSION = @LIBXML_VERSION@
LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@
LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@
LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MODULE_EXTENSION = @MODULE_EXTENSION@
MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@
MV = @MV@
M_LIBS = @M_LIBS@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PYTHON = @PYTHON@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@
PYTHON_SUBDIR = @PYTHON_SUBDIR@
PYTHON_TESTS = @PYTHON_TESTS@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
RDL_LIBS = @RDL_LIBS@
READER_TEST = @READER_TEST@
RELDATE = @RELDATE@
RM = @RM@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STATIC_BINARIES = @STATIC_BINARIES@
STRIP = @STRIP@
TAR = @TAR@
TEST_C14N = @TEST_C14N@
TEST_CATALOG = @TEST_CATALOG@
TEST_DEBUG = @TEST_DEBUG@
TEST_HTML = @TEST_HTML@
TEST_MODULES = @TEST_MODULES@
TEST_PATTERN = @TEST_PATTERN@
TEST_PHTML = @TEST_PHTML@
TEST_PUSH = @TEST_PUSH@
TEST_REGEXPS = @TEST_REGEXPS@
TEST_SAX = @TEST_SAX@
TEST_SCHEMAS = @TEST_SCHEMAS@
TEST_THREADS = @TEST_THREADS@
TEST_VALID = @TEST_VALID@
TEST_VTIME = @TEST_VTIME@
TEST_XINCLUDE = @TEST_XINCLUDE@
TEST_XPATH = @TEST_XPATH@
TEST_XPTR = @TEST_XPTR@
THREADS_W32 = @THREADS_W32@
THREAD_CFLAGS = @THREAD_CFLAGS@
THREAD_LIBS = @THREAD_LIBS@
U = @U@
VERSION = @VERSION@
WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@
WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@
WITH_C14N = @WITH_C14N@
WITH_CATALOG = @WITH_CATALOG@
WITH_DEBUG = @WITH_DEBUG@
WITH_DOCB = @WITH_DOCB@
WITH_FTP = @WITH_FTP@
WITH_HTML = @WITH_HTML@
WITH_HTTP = @WITH_HTTP@
WITH_ICONV = @WITH_ICONV@
WITH_ISO8859X = @WITH_ISO8859X@
WITH_LEGACY = @WITH_LEGACY@
WITH_MEM_DEBUG = @WITH_MEM_DEBUG@
WITH_MODULES = @WITH_MODULES@
WITH_OUTPUT = @WITH_OUTPUT@
WITH_PATTERN = @WITH_PATTERN@
WITH_PUSH = @WITH_PUSH@
WITH_PYTHON_FALSE = @WITH_PYTHON_FALSE@
WITH_PYTHON_TRUE = @WITH_PYTHON_TRUE@
WITH_READER = @WITH_READER@
WITH_REGEXPS = @WITH_REGEXPS@
WITH_RUN_DEBUG = @WITH_RUN_DEBUG@
WITH_SAX1 = @WITH_SAX1@
WITH_SCHEMAS = @WITH_SCHEMAS@
WITH_THREADS = @WITH_THREADS@
WITH_TREE = @WITH_TREE@
WITH_TRIO = @WITH_TRIO@
WITH_TRIO_SOURCES_FALSE = @WITH_TRIO_SOURCES_FALSE@
WITH_TRIO_SOURCES_TRUE = @WITH_TRIO_SOURCES_TRUE@
WITH_VALID = @WITH_VALID@
WITH_WRITER = @WITH_WRITER@
WITH_XINCLUDE = @WITH_XINCLUDE@
WITH_XPATH = @WITH_XPATH@
WITH_XPTR = @WITH_XPTR@
XINCLUDE_OBJ = @XINCLUDE_OBJ@
XMLLINT = @XMLLINT@
XML_CFLAGS = @XML_CFLAGS@
XML_INCLUDEDIR = @XML_INCLUDEDIR@
XML_LIBDIR = @XML_LIBDIR@
XML_LIBS = @XML_LIBS@
XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@
XPATH_OBJ = @XPATH_OBJ@
XPTR_OBJ = @XPTR_OBJ@
XSLTPROC = @XSLTPROC@
Z_CFLAGS = @Z_CFLAGS@
Z_LIBS = @Z_LIBS@
ac_ct_AR = @ac_ct_AR@
ac_ct_AS = @ac_ct_AS@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DLLTOOL = @ac_ct_DLLTOOL@
ac_ct_F77 = @ac_ct_F77@
ac_ct_OBJDUMP = @ac_ct_OBJDUMP@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
pythondir = @pythondir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
SUBDIRS = examples
# The top-level SGML file.
DOC_MAIN_XML_FILE = gnome-xml.xml
# The directory containing the source code (if it contains documentation).
DOC_SOURCE_DIR = ..
# A file in win32 depends upon one of the doc files
WIN32_DIR = $(top_srcdir)/win32
PAGES = architecture.html bugs.html contribs.html docs.html DOM.html \
downloads.html entities.html example.html help.html index.html \
interface.html intro.html library.html namespaces.html news.html \
tree.html xmldtd.html XMLinfo.html XSLT.html
APIPAGES = APIconstructors.html APIfiles.html APIfunctions.html \
APIsymbols.html APIchunk0.html
EXTRA_DIST = xmlcatalog_man.xml tutorial/*.html tutorial/*.c tutorial/*.pdf \
tutorial/images/*.png tutorial/images/callouts/*.png \
API*.html *.1 *.xsl *.html *.gif w3c.png html/*.html \
html/*.png libxml2-api.xml index.py search.php \
apibuild.py libxml2.xsa xmllint.xml xmlcatalog_man.xml \
README.docs
man_MANS = xmllint.1 xmlcatalog.1
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(mkdir_p) $(distdir)/html $(distdir)/tutorial $(distdir)/tutorial/images $(distdir)/tutorial/images/callouts
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(mkdir_p) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile $(MANS)
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am: install-data-local install-man
install-exec-am:
install-info: install-info-recursive
install-man: install-man1
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic \
maintainer-clean-local
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-info-am uninstall-man
uninstall-info: uninstall-info-recursive
uninstall-man: uninstall-man1
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
clean clean-generic clean-libtool clean-local clean-recursive \
ctags ctags-recursive distclean distclean-generic \
distclean-libtool distclean-recursive distclean-tags distdir \
dvi dvi-am html html-am info info-am install install-am \
install-data install-data-am install-data-local install-exec \
install-exec-am install-info install-info-am install-man \
install-man1 install-strip installcheck installcheck-am \
installdirs installdirs-am maintainer-clean \
maintainer-clean-generic maintainer-clean-local \
maintainer-clean-recursive mostlyclean mostlyclean-generic \
mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
tags tags-recursive uninstall uninstall-am uninstall-info-am \
uninstall-man uninstall-man1
all: web $(top_builddir)/NEWS libxml2.xsa $(man_MANS)
api: libxml2-api.xml libxml2-refs.xml $(APIPAGES) $(srcdir)/html/index.html $(WIN32_DIR)/libxml2.def.src ../elfgcchack.h
web: $(PAGES)
../elfgcchack.h: $(srcdir)/elfgcchack.xsl $(srcdir)/libxml2-api.xml
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the elfgcchack.h header" ; \
$(XSLTPROC) --nonet $(srcdir)/elfgcchack.xsl $(srcdir)/libxml2-api.xml > elfgcchack.h ; \
if [ "`diff -q elfgcchack.h ../elfgcchack.h`" ] ; then \
echo "updating ../elfgcchack.h"; \
cp elfgcchack.h ../elfgcchack.h; \
fi ; rm -f elfgcchack.h ; fi );
$(PAGES): xml.html site.xsl
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the HTML Web pages from xml.html" ; \
$(XSLTPROC) --nonet --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/xml.html > index.html ; fi );
-@(if [ -x $(XMLLINT) ] ; then \
echo "Validating the HTML Web pages" ; \
$(XMLLINT) --nonet --valid --noout $(PAGES) ; fi );
$(top_builddir)/NEWS: $(top_srcdir)/doc/news.xsl $(top_srcdir)/doc/news.html
-@(if [ -x $(XSLTPROC) ] ; then \
$(XSLTPROC) --nonet $(top_srcdir)/doc/news.xsl $(top_srcdir)/doc/news.html > $(top_builddir)/NEWS ; fi );
libxml2.xsa: $(top_srcdir)/doc/xsa.xsl $(top_srcdir)/doc/news.html
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the NEWS file" ; \
$(XSLTPROC) --nonet $(top_srcdir)/doc/xsa.xsl $(top_srcdir)/doc/news.html > libxml2.xsa ; fi );
$(APIPAGES): libxml2-api.xml libxml2-refs.xml $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/api.xsl
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the HTML API pages from libxml2-refs.xml" ; \
$(XSLTPROC) --nonet --html $(top_srcdir)/doc/api.xsl \
$(top_srcdir)/doc/xml.html ; fi );
-@(if [ -x $(XMLLINT) ] ; then \
echo "Validating the HTML API pages" ; \
$(XMLLINT) --nonet --valid --noout API*.html ; fi );
$(srcdir)/html/index.html: libxml2-api.xml $(srcdir)/newapi.xsl
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the HTML pages from the XML API" ; \
$(XSLTPROC) --nonet $(srcdir)/newapi.xsl libxml2-api.xml ; fi )
-@(if [ -x $(XMLLINT) ] ; then \
echo "Validating the resulting XHTML pages" ; \
$(XMLLINT) --nonet --valid --noout html/*.html ; fi );
wiki: libxml2-api.xml $(srcdir)/wiki.xsl
-@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the wiki HTML pages from the XML API" ; \
$(XSLTPROC) --nonet $(srcdir)/wiki.xsl libxml2-api.xml; fi )
$(WIN32_DIR)/libxml2.def.src: libxml2-api.xml
-@(if [ -x $(XSLTPROC) ] ; then \
$(XSLTPROC) -o $(WIN32_DIR)/libxml2.def.src \
--nonet $(WIN32_DIR)/defgen.xsl libxml2-api.xml ; fi )
libxml2-api.xml libxml2-refs.xml: apibuild.py ../include/libxml/*.h ../*.c
-(./apibuild.py)
-@(cd .. ; $(MAKE) rebuild_testapi)
xmllint.1: xmllint.xml
-@($(XSLTPROC) --nonet xmllint.xml)
xmlcatalog.1: xmlcatalog_man.xml
-@($(XSLTPROC) --nonet xmlcatalog_man.xml)
clean-local:
rm -f *~ *.bak *.hierarchy *.signals *-unused.txt
maintainer-clean-local: clean-local
rm -rf libxml-decl-list.txt libxml-decl.txt
rebuild: api all
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
-@INSTALL@ -m 0644 $(srcdir)/xml.html $(srcdir)/encoding.html $(srcdir)/FAQ.html $(srcdir)/structure.gif $(srcdir)/DOM.gif $(srcdir)/smallfootonly.gif $(srcdir)/redhat.gif $(srcdir)/libxml.gif $(srcdir)/w3c.png $(srcdir)/Libxml2-Logo-180x168.gif $(srcdir)/Libxml2-Logo-90x34.gif $(DESTDIR)$(HTML_DIR)
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html
-@INSTALL@ -m 0644 $(srcdir)/html/*.html $(DESTDIR)$(HTML_DIR)/html
-@INSTALL@ -m 0644 $(srcdir)/html/*.png $(DESTDIR)$(HTML_DIR)/html
-@INSTALL@ -m 0644 $(srcdir)/html/index.sgml $(DESTDIR)$(HTML_DIR)/html
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/tutorial
-@INSTALL@ -m 0644 $(srcdir)/tutorial/*.* \
$(DESTDIR)$(HTML_DIR)/tutorial
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/tutorial/images
-@INSTALL@ -m 0644 $(srcdir)/tutorial/images/*.* \
$(DESTDIR)$(HTML_DIR)/tutorial/images
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/tutorial/images/callouts
-@INSTALL@ -m 0644 $(srcdir)/tutorial/images/callouts/*.* \
$(DESTDIR)$(HTML_DIR)/tutorial/images/callouts
.PHONY : html xml templates scan
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View file

@ -0,0 +1,24 @@
XML toolkit from the GNOME project
Full documentation is available on-line at
http://xmlsoft.org/
This code is released under the MIT Licence see the Copyright file.
To report bugs, follow the instructions at:
http://xmlsoft.org/bugs.html
A mailing-list xml@gnome.org is available, to subscribe:
http://mail.gnome.org/mailman/listinfo/xml
The list archive is at:
http://mail.gnome.org/archives/xml/
All technical answers asked privately will be automatically answered on
the list and archived for public access unless pricacy is explicitely
required and justified.
Daniel Veillard
$Id: README.docs,v 1.1 2003/09/01 04:58:15 wbrack Exp $

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css">
TD {font-family: Verdana,Arial,Helvetica}
BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
H1 {font-family: Verdana,Arial,Helvetica}
H2 {font-family: Verdana,Arial,Helvetica}
H3 {font-family: Verdana,Arial,Helvetica}
A:link, A:visited, A:active { text-decoration: underline }
</style><title>XML</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1>The XML C parser and toolkit of Gnome</h1><h2>XML</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Main Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a href="index.html">Home</a></li><li><a href="http://xmlsoft.org/wiki">Wiki</a></li><li><a href="html/index.html">Reference Manual</a></li><li><a href="intro.html">Introduction</a></li><li><a href="FAQ.html">FAQ</a></li><li><a href="docs.html" style="font-weight:bold">Developer Menu</a></li><li><a href="bugs.html">Reporting bugs and getting help</a></li><li><a href="help.html">How to help</a></li><li><a href="downloads.html">Downloads</a></li><li><a href="news.html">Releases</a></li><li><a href="XMLinfo.html">XML</a></li><li><a href="XSLT.html">XSLT</a></li><li><a href="xmldtd.html">Validation &amp; DTDs</a></li><li><a href="encoding.html">Encodings support</a></li><li><a href="catalog.html">Catalog support</a></li><li><a href="namespaces.html">Namespaces</a></li><li><a href="contribs.html">Contributions</a></li><li><a href="examples/index.html" style="font-weight:bold">Code Examples</a></li><li><a href="html/index.html" style="font-weight:bold">API Menu</a></li><li><a href="guidelines.html">XML Guidelines</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://www.blastwave.org/packages.php/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://rubyforge.org/projects/xml-tools/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><p><a href="http://www.w3.org/TR/REC-xml">XML is a standard</a> for
markup-based structured documents. Here is <a name="example" id="example">an example XML
document</a>:</p><pre>&lt;?xml version="1.0"?&gt;
&lt;EXAMPLE prop1="gnome is great" prop2="&amp;amp; linux too"&gt;
&lt;head&gt;
&lt;title&gt;Welcome to Gnome&lt;/title&gt;
&lt;/head&gt;
&lt;chapter&gt;
&lt;title&gt;The Linux adventure&lt;/title&gt;
&lt;p&gt;bla bla bla ...&lt;/p&gt;
&lt;image href="linus.gif"/&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;/chapter&gt;
&lt;/EXAMPLE&gt;</pre><p>The first line specifies that it is an XML document and gives useful
information about its encoding. Then the rest of the document is a text
format whose structure is specified by tags between brackets. <strong>Each
tag opened has to be closed</strong>. XML is pedantic about this. However, if
a tag is empty (no content), a single tag can serve as both the opening and
closing tag if it ends with <code>/&gt;</code> rather than with
<code>&gt;</code>. Note that, for example, the image tag has no content (just
an attribute) and is closed by ending the tag with <code>/&gt;</code>.</p><p>XML can be applied successfully to a wide range of tasks, ranging from
long term structured document maintenance (where it follows the steps of
SGML) to simple data encoding mechanisms like configuration file formatting
(glade), spreadsheets (gnumeric), or even shorter lived documents such as
WebDAV where it is used to encode remote calls between a client and a
server.</p><p><a href="bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css">
TD {font-family: Verdana,Arial,Helvetica}
BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
H1 {font-family: Verdana,Arial,Helvetica}
H2 {font-family: Verdana,Arial,Helvetica}
H3 {font-family: Verdana,Arial,Helvetica}
A:link, A:visited, A:active { text-decoration: underline }
</style><title>XSLT</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1>The XML C parser and toolkit of Gnome</h1><h2>XSLT</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Main Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a href="index.html">Home</a></li><li><a href="http://xmlsoft.org/wiki">Wiki</a></li><li><a href="html/index.html">Reference Manual</a></li><li><a href="intro.html">Introduction</a></li><li><a href="FAQ.html">FAQ</a></li><li><a href="docs.html" style="font-weight:bold">Developer Menu</a></li><li><a href="bugs.html">Reporting bugs and getting help</a></li><li><a href="help.html">How to help</a></li><li><a href="downloads.html">Downloads</a></li><li><a href="news.html">Releases</a></li><li><a href="XMLinfo.html">XML</a></li><li><a href="XSLT.html">XSLT</a></li><li><a href="xmldtd.html">Validation &amp; DTDs</a></li><li><a href="encoding.html">Encodings support</a></li><li><a href="catalog.html">Catalog support</a></li><li><a href="namespaces.html">Namespaces</a></li><li><a href="contribs.html">Contributions</a></li><li><a href="examples/index.html" style="font-weight:bold">Code Examples</a></li><li><a href="html/index.html" style="font-weight:bold">API Menu</a></li><li><a href="guidelines.html">XML Guidelines</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://www.blastwave.org/packages.php/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://rubyforge.org/projects/xml-tools/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><p>Check <a href="http://xmlsoft.org/XSLT">the separate libxslt page</a></p><p><a href="http://www.w3.org/TR/xslt">XSL Transformations</a>, is a
language for transforming XML documents into other XML documents (or
HTML/textual output).</p><p>A separate library called libxslt is available implementing XSLT-1.0 for
libxml2. This module "libxslt" too can be found in the Gnome CVS base.</p><p>You can check the <a href="http://cvs.gnome.org/lxr/source/libxslt/FEATURES">features</a>
supported and the progresses on the <a href="http://cvs.gnome.org/lxr/source/libxslt/ChangeLog" name="Changelog" id="Changelog">Changelog</a>.</p><p><a href="bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>

View file

@ -0,0 +1,394 @@
<?xml version="1.0"?>
<!-- this stylesheet builds the API*.html , it works based on libxml2-refs.xml
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
exclude-result-prefixes="exsl">
<!-- Import the rest of the site stylesheets -->
<xsl:import href="site.xsl"/>
<!-- Generate XHTML-1.0 transitional -->
<xsl:output method="xml" encoding="ISO-8859-1" indent="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:variable name="href_base" select="''"/>
<xsl:variable name="apirefs" select="document('libxml2-refs.xml')"/>
<xsl:variable name="module" select="$apirefs/apirefs/@name"/>
<xsl:key name="refhref" match="reference" use="@name"/>
<xsl:template match="ref" mode="anchor">
<xsl:variable name="name" select="@name"/>
<xsl:for-each select="document('libxml2-refs.xml')">
<a href="{key('refhref', $name)/@href}"><xsl:value-of select="$name"/></a><br/>
</xsl:for-each>
</xsl:template>
<xsl:template match="type" mode="reflist">
<h2>Type <xsl:value-of select="@name"/>:</h2>
<p>
<xsl:for-each select="ref">
<xsl:apply-templates mode="anchor" select="."/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</p>
</xsl:template>
<xsl:template match="letter" mode="reflist">
<h2>Letter <xsl:value-of select="@name"/>:</h2>
<p>
<xsl:for-each select="ref">
<xsl:apply-templates mode="anchor" select="."/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</p>
</xsl:template>
<xsl:template match="file" mode="reflist">
<h2><a name="{@name}">Module <xsl:value-of select="@name"/></a>:</h2>
<p>
<xsl:for-each select="ref">
<xsl:apply-templates mode="anchor" select="."/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</p>
</xsl:template>
<xsl:template match="letter" mode="wordlist">
<h2>Letter <xsl:value-of select="@name"/>:</h2>
<dl>
<xsl:for-each select="word">
<dt><xsl:value-of select="@name"/></dt>
<dd>
<xsl:for-each select="ref">
<xsl:apply-templates mode="anchor" select="."/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</dd>
</xsl:for-each>
</dl>
</xsl:template>
<xsl:template match="constructors">
<xsl:message>Generating API Constructors</xsl:message>
<xsl:variable name="title">List of constructors for <xsl:value-of select="$module"/></xsl:variable>
<xsl:document href="APIconstructors.html" method="xml" encoding="ISO-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<xsl:call-template name="style"/>
<xsl:element name="title">
<xsl:value-of select="$title"/>
</xsl:element>
</head>
<body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
<xsl:call-template name="titlebox">
<xsl:with-param name="title" select="$title"/>
</xsl:call-template>
<table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
<tr>
<td bgcolor="#8b7765">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td valign="top" width="200" bgcolor="#8b7765">
<xsl:call-template name="develtoc"/>
</td>
<td valign="top" bgcolor="#8b7765">
<table border="0" cellspacing="0" cellpadding="1" width="100%">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="1" width="100%">
<tr>
<td bgcolor="#fffacd">
<xsl:apply-templates mode="reflist" select="type"/>
<p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</xsl:document>
</xsl:template>
<xsl:template match="files">
<xsl:message>Generating API List of synbols per file</xsl:message>
<xsl:variable name="title">List of Symbols per Module for <xsl:value-of select="$module"/></xsl:variable>
<xsl:document href="APIfiles.html" method="xml" encoding="ISO-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<xsl:call-template name="style"/>
<xsl:element name="title">
<xsl:value-of select="$title"/>
</xsl:element>
</head>
<body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
<xsl:call-template name="titlebox">
<xsl:with-param name="title" select="$title"/>
</xsl:call-template>
<table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
<tr>
<td bgcolor="#8b7765">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td valign="top" width="200" bgcolor="#8b7765">
<xsl:call-template name="develtoc"/>
</td>
<td valign="top" bgcolor="#8b7765">
<table border="0" cellspacing="0" cellpadding="1" width="100%">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="1" width="100%">
<tr>
<td bgcolor="#fffacd">
<xsl:apply-templates mode="reflist" select="file"/>
<p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</xsl:document>
</xsl:template>
<xsl:template match="functions">
<xsl:message>Generating API Functions by Type</xsl:message>
<xsl:variable name="title">List of function manipulating types in <xsl:value-of select="$module"/></xsl:variable>
<xsl:document href="APIfunctions.html" method="xml" encoding="ISO-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<xsl:call-template name="style"/>
<xsl:element name="title">
<xsl:value-of select="$title"/>
</xsl:element>
</head>
<body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
<xsl:call-template name="titlebox">
<xsl:with-param name="title" select="$title"/>
</xsl:call-template>
<table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
<tr>
<td bgcolor="#8b7765">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td valign="top" width="200" bgcolor="#8b7765">
<xsl:call-template name="develtoc"/>
</td>
<td valign="top" bgcolor="#8b7765">
<table border="0" cellspacing="0" cellpadding="1" width="100%">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="1" width="100%">
<tr>
<td bgcolor="#fffacd">
<xsl:apply-templates mode="reflist" select="type"/>
<p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</xsl:document>
</xsl:template>
<xsl:template match="alpha">
<xsl:message>Generating API Alphabetic list</xsl:message>
<xsl:variable name="title">Alphabetic List of Symbols in <xsl:value-of select="$module"/></xsl:variable>
<xsl:document href="APIsymbols.html" method="xml" encoding="ISO-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<xsl:call-template name="style"/>
<xsl:element name="title">
<xsl:value-of select="$title"/>
</xsl:element>
</head>
<body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
<xsl:call-template name="titlebox">
<xsl:with-param name="title" select="$title"/>
</xsl:call-template>
<table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
<tr>
<td bgcolor="#8b7765">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td valign="top" width="200" bgcolor="#8b7765">
<xsl:call-template name="develtoc"/>
</td>
<td valign="top" bgcolor="#8b7765">
<table border="0" cellspacing="0" cellpadding="1" width="100%">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="1" width="100%">
<tr>
<td bgcolor="#fffacd">
<xsl:apply-templates mode="reflist" select="letter"/>
<p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</xsl:document>
</xsl:template>
<xsl:template name="apichunks">
<h2 align="center">
<xsl:for-each select="/apirefs/index/chunks/chunk">
<xsl:variable name="name" select="@name"/>
<xsl:variable name="start" select="@start"/>
<xsl:variable name="end" select="@end"/>
<xsl:variable name="block" select="concat($start, '-', $end)"/>
<a href="API{$name}.html"><xsl:value-of select="$block"/></a>
<xsl:text>
</xsl:text>
</xsl:for-each>
</h2>
</xsl:template>
<xsl:template match="chunk">
<xsl:variable name="name" select="@name"/>
<xsl:variable name="start" select="@start"/>
<xsl:variable name="end" select="@end"/>
<xsl:variable name="block" select="concat($start, '-', $end)"/>
<xsl:variable name="target" select="/apirefs/index/chunk[@name = $name]"/>
<xsl:variable name="title">API Alphabetic Index <xsl:value-of select="$block"/> for <xsl:value-of select="$module"/></xsl:variable>
<xsl:document href="API{$name}.html" method="xml" encoding="ISO-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<xsl:call-template name="style"/>
<xsl:element name="title">
<xsl:value-of select="$title"/>
</xsl:element>
</head>
<body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
<xsl:call-template name="titlebox">
<xsl:with-param name="title" select="$title"/>
</xsl:call-template>
<table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
<tr>
<td bgcolor="#8b7765">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td valign="top" width="200" bgcolor="#8b7765">
<xsl:call-template name="develtoc"/>
</td>
<td valign="top" bgcolor="#8b7765">
<table border="0" cellspacing="0" cellpadding="1" width="100%">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="1" width="100%">
<tr>
<td bgcolor="#fffacd">
<xsl:call-template name="apichunks"/>
<xsl:apply-templates mode="wordlist"
select="$target/letter"/>
<xsl:call-template name="apichunks"/>
<p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</xsl:document>
</xsl:template>
<xsl:template match="index">
<xsl:message>Generating API Index</xsl:message>
<xsl:apply-templates select="chunks/chunk"/>
</xsl:template>
<xsl:template match="apirefs">
<xsl:message>Generating API Cross References</xsl:message>
<xsl:apply-templates select="constructors"/>
<xsl:apply-templates select="functions"/>
<xsl:apply-templates select="alpha"/>
<xsl:apply-templates select="files"/>
<xsl:apply-templates select="index"/>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="$apirefs/apirefs"/>
</xsl:template>
</xsl:stylesheet>

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css">
TD {font-family: Verdana,Arial,Helvetica}
BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
H1 {font-family: Verdana,Arial,Helvetica}
H2 {font-family: Verdana,Arial,Helvetica}
H3 {font-family: Verdana,Arial,Helvetica}
A:link, A:visited, A:active { text-decoration: underline }
</style><title>Reporting bugs and getting help</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1>The XML C parser and toolkit of Gnome</h1><h2>Reporting bugs and getting help</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Main Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a href="index.html">Home</a></li><li><a href="http://xmlsoft.org/wiki">Wiki</a></li><li><a href="html/index.html">Reference Manual</a></li><li><a href="intro.html">Introduction</a></li><li><a href="FAQ.html">FAQ</a></li><li><a href="docs.html" style="font-weight:bold">Developer Menu</a></li><li><a href="bugs.html">Reporting bugs and getting help</a></li><li><a href="help.html">How to help</a></li><li><a href="downloads.html">Downloads</a></li><li><a href="news.html">Releases</a></li><li><a href="XMLinfo.html">XML</a></li><li><a href="XSLT.html">XSLT</a></li><li><a href="xmldtd.html">Validation &amp; DTDs</a></li><li><a href="encoding.html">Encodings support</a></li><li><a href="catalog.html">Catalog support</a></li><li><a href="namespaces.html">Namespaces</a></li><li><a href="contribs.html">Contributions</a></li><li><a href="examples/index.html" style="font-weight:bold">Code Examples</a></li><li><a href="html/index.html" style="font-weight:bold">API Menu</a></li><li><a href="guidelines.html">XML Guidelines</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://www.blastwave.org/packages.php/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://rubyforge.org/projects/xml-tools/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><p>Well, bugs or missing features are always possible, and I will make a
point of fixing them in a timely fashion. The best way to report a bug is to
use the <a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Gnome
bug tracking database</a> (make sure to use the "libxml2" module name). I
look at reports there regularly and it's good to have a reminder when a bug
is still open. Be sure to specify that the bug is for the package libxml2.</p><p>For small problems you can try to get help on IRC, the #xml channel on
irc.gnome.org (port 6667) usually have a few person subscribed which may help
(but there is no garantee and if a real issue is raised it should go on the
mailing-list for archival).</p><p>There is also a mailing-list <a href="mailto:xml@gnome.org">xml@gnome.org</a> for libxml, with an <a href="http://mail.gnome.org/archives/xml/">on-line archive</a> (<a href="http://xmlsoft.org/messages">old</a>). To subscribe to this list,
please visit the <a href="http://mail.gnome.org/mailman/listinfo/xml">associated Web</a> page and
follow the instructions. <strong>Do not send code, I won't debug it</strong>
(but patches are really appreciated!).</p><p>Please note that with the current amount of virus and SPAM, sending mail
to the list without being subscribed won't work. There is *far too many
bounces* (in the order of a thousand a day !) I cannot approve them manually
anymore. If your mail to the list bounced waiting for administrator approval,
it is LOST ! Repost it and fix the problem triggering the error.</p><p>Check the following <strong><span style="color: #FF0000">before
posting</span></strong>:</p><ul><li>Read the <a href="FAQ.html">FAQ</a> and <a href="search.php">use the
search engine</a> to get information related to your problem.</li>
<li>Make sure you are <a href="ftp://xmlsoft.org/">using a recent
version</a>, and that the problem still shows up in a recent version.</li>
<li>Check the <a href="http://mail.gnome.org/archives/xml/">list
archives</a> to see if the problem was reported already. In this case
there is probably a fix available, similarly check the <a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">registered
open bugs</a>.</li>
<li>Make sure you can reproduce the bug with xmllint or one of the test
programs found in source in the distribution.</li>
<li>Please send the command showing the error as well as the input (as an
attachment)</li>
</ul><p>Then send the bug with associated information to reproduce it to the <a href="mailto:xml@gnome.org">xml@gnome.org</a> list; if it's really libxml
related I will approve it. Please do not send mail to me directly, it makes
things really hard to track and in some cases I am not the best person to
answer a given question, ask on the list.</p><p>To <span style="color: #E50000">be really clear about support</span>:</p><ul><li>Support or help <span style="color: #E50000">requests MUST be sent to
the list or on bugzilla</span> in case of problems, so that the Question
and Answers can be shared publicly. Failing to do so carries the implicit
message "I want free support but I don't want to share the benefits with
others" and is not welcome. I will automatically Carbon-Copy the
xml@gnome.org mailing list for any technical reply made about libxml2 or
libxslt.</li>
<li>There is <span style="color: #E50000">no garantee of support</span>, if
your question remains unanswered after a week, repost it, making sure you
gave all the detail needed and the information requested.</li>
<li>Failing to provide information as requested or double checking first
for prior feedback also carries the implicit message "the time of the
library maintainers is less valuable than my time" and might not be
welcome.</li>
</ul><p>Of course, bugs reported with a suggested patch for fixing them will
probably be processed faster than those without.</p><p>If you're looking for help, a quick look at <a href="http://mail.gnome.org/archives/xml/">the list archive</a> may actually
provide the answer. I usually send source samples when answering libxml2
usage questions. The <a href="http://xmlsoft.org/html/book1.html">auto-generated documentation</a> is
not as polished as I would like (i need to learn more about DocBook), but
it's a good starting point.</p><p><a href="bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

View file

@ -0,0 +1,256 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css">
TD {font-family: Verdana,Arial,Helvetica}
BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
H1 {font-family: Verdana,Arial,Helvetica}
H2 {font-family: Verdana,Arial,Helvetica}
H3 {font-family: Verdana,Arial,Helvetica}
A:link, A:visited, A:active { text-decoration: underline }
</style><title>Catalog support</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1>The XML C parser and toolkit of Gnome</h1><h2>Catalog support</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Main Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a href="index.html">Home</a></li><li><a href="http://xmlsoft.org/wiki">Wiki</a></li><li><a href="html/index.html">Reference Manual</a></li><li><a href="intro.html">Introduction</a></li><li><a href="FAQ.html">FAQ</a></li><li><a href="docs.html" style="font-weight:bold">Developer Menu</a></li><li><a href="bugs.html">Reporting bugs and getting help</a></li><li><a href="help.html">How to help</a></li><li><a href="downloads.html">Downloads</a></li><li><a href="news.html">Releases</a></li><li><a href="XMLinfo.html">XML</a></li><li><a href="XSLT.html">XSLT</a></li><li><a href="xmldtd.html">Validation &amp; DTDs</a></li><li><a href="encoding.html">Encodings support</a></li><li><a href="catalog.html">Catalog support</a></li><li><a href="namespaces.html">Namespaces</a></li><li><a href="contribs.html">Contributions</a></li><li><a href="examples/index.html" style="font-weight:bold">Code Examples</a></li><li><a href="html/index.html" style="font-weight:bold">API Menu</a></li><li><a href="guidelines.html">XML Guidelines</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://www.blastwave.org/packages.php/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://rubyforge.org/projects/xml-tools/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><p>Table of Content:</p><ol><li><a href="General2">General overview</a></li>
<li><a href="#definition">The definition</a></li>
<li><a href="#Simple">Using catalogs</a></li>
<li><a href="#Some">Some examples</a></li>
<li><a href="#reference">How to tune catalog usage</a></li>
<li><a href="#validate">How to debug catalog processing</a></li>
<li><a href="#Declaring">How to create and maintain catalogs</a></li>
<li><a href="#implemento">The implementor corner quick review of the
API</a></li>
<li><a href="#Other">Other resources</a></li>
</ol><h3><a name="General2" id="General2">General overview</a></h3><p>What is a catalog? Basically it's a lookup mechanism used when an entity
(a file or a remote resource) references another entity. The catalog lookup
is inserted between the moment the reference is recognized by the software
(XML parser, stylesheet processing, or even images referenced for inclusion
in a rendering) and the time where loading that resource is actually
started.</p><p>It is basically used for 3 things:</p><ul><li>mapping from "logical" names, the public identifiers and a more
concrete name usable for download (and URI). For example it can associate
the logical name
<p>"-//OASIS//DTD DocBook XML V4.1.2//EN"</p>
<p>of the DocBook 4.1.2 XML DTD with the actual URL where it can be
downloaded</p>
<p>http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd</p>
</li>
<li>remapping from a given URL to another one, like an HTTP indirection
saying that
<p>"http://www.oasis-open.org/committes/tr.xsl"</p>
<p>should really be looked at</p>
<p>"http://www.oasis-open.org/committes/entity/stylesheets/base/tr.xsl"</p>
</li>
<li>providing a local cache mechanism allowing to load the entities
associated to public identifiers or remote resources, this is a really
important feature for any significant deployment of XML or SGML since it
allows to avoid the aleas and delays associated to fetching remote
resources.</li>
</ul><h3><a name="definition" id="definition">The definitions</a></h3><p>Libxml, as of 2.4.3 implements 2 kind of catalogs:</p><ul><li>the older SGML catalogs, the official spec is SGML Open Technical
Resolution TR9401:1997, but is better understood by reading <a href="http://www.jclark.com/sp/catalog.htm">the SP Catalog page</a> from
James Clark. This is relatively old and not the preferred mode of
operation of libxml.</li>
<li><a href="http://www.oasis-open.org/committees/entity/spec.html">XML
Catalogs</a> is far more flexible, more recent, uses an XML syntax and
should scale quite better. This is the default option of libxml.</li>
</ul><p></p><h3><a name="Simple" id="Simple">Using catalog</a></h3><p>In a normal environment libxml2 will by default check the presence of a
catalog in /etc/xml/catalog, and assuming it has been correctly populated,
the processing is completely transparent to the document user. To take a
concrete example, suppose you are authoring a DocBook document, this one
starts with the following DOCTYPE definition:</p><pre>&lt;?xml version='1.0'?&gt;
&lt;!DOCTYPE book PUBLIC "-//Norman Walsh//DTD DocBk XML V3.1.4//EN"
"http://nwalsh.com/docbook/xml/3.1.4/db3xml.dtd"&gt;</pre><p>When validating the document with libxml, the catalog will be
automatically consulted to lookup the public identifier "-//Norman Walsh//DTD
DocBk XML V3.1.4//EN" and the system identifier
"http://nwalsh.com/docbook/xml/3.1.4/db3xml.dtd", and if these entities have
been installed on your system and the catalogs actually point to them, libxml
will fetch them from the local disk.</p><p style="font-size: 10pt"><strong>Note</strong>: Really don't use this
DOCTYPE example it's a really old version, but is fine as an example.</p><p>Libxml2 will check the catalog each time that it is requested to load an
entity, this includes DTD, external parsed entities, stylesheets, etc ... If
your system is correctly configured all the authoring phase and processing
should use only local files, even if your document stays portable because it
uses the canonical public and system ID, referencing the remote document.</p><h3><a name="Some" id="Some">Some examples:</a></h3><p>Here is a couple of fragments from XML Catalogs used in libxml2 early
regression tests in <code>test/catalogs</code> :</p><pre>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE catalog PUBLIC
"-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"&gt;
&lt;catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"&gt;
&lt;public publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
uri="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"/&gt;
...</pre><p>This is the beginning of a catalog for DocBook 4.1.2, XML Catalogs are
written in XML, there is a specific namespace for catalog elements
"urn:oasis:names:tc:entity:xmlns:xml:catalog". The first entry in this
catalog is a <code>public</code> mapping it allows to associate a Public
Identifier with an URI.</p><pre>...
&lt;rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/"
rewritePrefix="file:///usr/share/xml/docbook/"/&gt;
...</pre><p>A <code>rewriteSystem</code> is a very powerful instruction, it says that
any URI starting with a given prefix should be looked at another URI
constructed by replacing the prefix with an new one. In effect this acts like
a cache system for a full area of the Web. In practice it is extremely useful
with a file prefix if you have installed a copy of those resources on your
local system.</p><pre>...
&lt;delegatePublic publicIdStartString="-//OASIS//DTD XML Catalog //"
catalog="file:///usr/share/xml/docbook.xml"/&gt;
&lt;delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook XML"
catalog="file:///usr/share/xml/docbook.xml"/&gt;
&lt;delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML"
catalog="file:///usr/share/xml/docbook.xml"/&gt;
&lt;delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/"
catalog="file:///usr/share/xml/docbook.xml"/&gt;
&lt;delegateURI uriStartString="http://www.oasis-open.org/docbook/"
catalog="file:///usr/share/xml/docbook.xml"/&gt;
...</pre><p>Delegation is the core features which allows to build a tree of catalogs,
easier to maintain than a single catalog, based on Public Identifier, System
Identifier or URI prefixes it instructs the catalog software to look up
entries in another resource. This feature allow to build hierarchies of
catalogs, the set of entries presented should be sufficient to redirect the
resolution of all DocBook references to the specific catalog in
<code>/usr/share/xml/docbook.xml</code> this one in turn could delegate all
references for DocBook 4.2.1 to a specific catalog installed at the same time
as the DocBook resources on the local machine.</p><h3><a name="reference" id="reference">How to tune catalog usage:</a></h3><p>The user can change the default catalog behaviour by redirecting queries
to its own set of catalogs, this can be done by setting the
<code>XML_CATALOG_FILES</code> environment variable to a list of catalogs, an
empty one should deactivate loading the default <code>/etc/xml/catalog</code>
default catalog</p><h3><a name="validate" id="validate">How to debug catalog processing:</a></h3><p>Setting up the <code>XML_DEBUG_CATALOG</code> environment variable will
make libxml2 output debugging informations for each catalog operations, for
example:</p><pre>orchis:~/XML -&gt; xmllint --memory --noout test/ent2
warning: failed to load external entity "title.xml"
orchis:~/XML -&gt; export XML_DEBUG_CATALOG=
orchis:~/XML -&gt; xmllint --memory --noout test/ent2
Failed to parse catalog /etc/xml/catalog
Failed to parse catalog /etc/xml/catalog
warning: failed to load external entity "title.xml"
Catalogs cleanup
orchis:~/XML -&gt; </pre><p>The test/ent2 references an entity, running the parser from memory makes
the base URI unavailable and the the "title.xml" entity cannot be loaded.
Setting up the debug environment variable allows to detect that an attempt is
made to load the <code>/etc/xml/catalog</code> but since it's not present the
resolution fails.</p><p>But the most advanced way to debug XML catalog processing is to use the
<strong>xmlcatalog</strong> command shipped with libxml2, it allows to load
catalogs and make resolution queries to see what is going on. This is also
used for the regression tests:</p><pre>orchis:~/XML -&gt; ./xmlcatalog test/catalogs/docbook.xml \
"-//OASIS//DTD DocBook XML V4.1.2//EN"
http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
orchis:~/XML -&gt; </pre><p>For debugging what is going on, adding one -v flags increase the verbosity
level to indicate the processing done (adding a second flag also indicate
what elements are recognized at parsing):</p><pre>orchis:~/XML -&gt; ./xmlcatalog -v test/catalogs/docbook.xml \
"-//OASIS//DTD DocBook XML V4.1.2//EN"
Parsing catalog test/catalogs/docbook.xml's content
Found public match -//OASIS//DTD DocBook XML V4.1.2//EN
http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
Catalogs cleanup
orchis:~/XML -&gt; </pre><p>A shell interface is also available to debug and process multiple queries
(and for regression tests):</p><pre>orchis:~/XML -&gt; ./xmlcatalog -shell test/catalogs/docbook.xml \
"-//OASIS//DTD DocBook XML V4.1.2//EN"
&gt; help
Commands available:
public PublicID: make a PUBLIC identifier lookup
system SystemID: make a SYSTEM identifier lookup
resolve PublicID SystemID: do a full resolver lookup
add 'type' 'orig' 'replace' : add an entry
del 'values' : remove values
dump: print the current catalog state
debug: increase the verbosity level
quiet: decrease the verbosity level
exit: quit the shell
&gt; public "-//OASIS//DTD DocBook XML V4.1.2//EN"
http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
&gt; quit
orchis:~/XML -&gt; </pre><p>This should be sufficient for most debugging purpose, this was actually
used heavily to debug the XML Catalog implementation itself.</p><h3><a name="Declaring" id="Declaring">How to create and maintain</a> catalogs:</h3><p>Basically XML Catalogs are XML files, you can either use XML tools to
manage them or use <strong>xmlcatalog</strong> for this. The basic step is
to create a catalog the -create option provide this facility:</p><pre>orchis:~/XML -&gt; ./xmlcatalog --create tst.xml
&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"&gt;
&lt;catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"/&gt;
orchis:~/XML -&gt; </pre><p>By default xmlcatalog does not overwrite the original catalog and save the
result on the standard output, this can be overridden using the -noout
option. The <code>-add</code> command allows to add entries in the
catalog:</p><pre>orchis:~/XML -&gt; ./xmlcatalog --noout --create --add "public" \
"-//OASIS//DTD DocBook XML V4.1.2//EN" \
http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd tst.xml
orchis:~/XML -&gt; cat tst.xml
&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" \
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"&gt;
&lt;catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"&gt;
&lt;public publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
uri="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"/&gt;
&lt;/catalog&gt;
orchis:~/XML -&gt; </pre><p>The <code>-add</code> option will always take 3 parameters even if some of
the XML Catalog constructs (like nextCatalog) will have only a single
argument, just pass a third empty string, it will be ignored.</p><p>Similarly the <code>-del</code> option remove matching entries from the
catalog:</p><pre>orchis:~/XML -&gt; ./xmlcatalog --del \
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" tst.xml
&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"&gt;
&lt;catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"/&gt;
orchis:~/XML -&gt; </pre><p>The catalog is now empty. Note that the matching of <code>-del</code> is
exact and would have worked in a similar fashion with the Public ID
string.</p><p>This is rudimentary but should be sufficient to manage a not too complex
catalog tree of resources.</p><h3><a name="implemento" id="implemento">The implementor corner quick review of the
API:</a></h3><p>First, and like for every other module of libxml, there is an
automatically generated <a href="html/libxml-catalog.html">API page for
catalog support</a>.</p><p>The header for the catalog interfaces should be included as:</p><pre>#include &lt;libxml/catalog.h&gt;</pre><p>The API is voluntarily kept very simple. First it is not obvious that
applications really need access to it since it is the default behaviour of
libxml2 (Note: it is possible to completely override libxml2 default catalog
by using <a href="html/libxml-parser.html">xmlSetExternalEntityLoader</a> to
plug an application specific resolver).</p><p>Basically libxml2 support 2 catalog lists:</p><ul><li>the default one, global shared by all the application</li>
<li>a per-document catalog, this one is built if the document uses the
<code>oasis-xml-catalog</code> PIs to specify its own catalog list, it is
associated to the parser context and destroyed when the parsing context
is destroyed.</li>
</ul><p>the document one will be used first if it exists.</p><h4>Initialization routines:</h4><p>xmlInitializeCatalog(), xmlLoadCatalog() and xmlLoadCatalogs() should be
used at startup to initialize the catalog, if the catalog should be
initialized with specific values xmlLoadCatalog() or xmlLoadCatalogs()
should be called before xmlInitializeCatalog() which would otherwise do a
default initialization first.</p><p>The xmlCatalogAddLocal() call is used by the parser to grow the document
own catalog list if needed.</p><h4>Preferences setup:</h4><p>The XML Catalog spec requires the possibility to select default
preferences between public and system delegation,
xmlCatalogSetDefaultPrefer() allows this, xmlCatalogSetDefaults() and
xmlCatalogGetDefaults() allow to control if XML Catalogs resolution should
be forbidden, allowed for global catalog, for document catalog or both, the
default is to allow both.</p><p>And of course xmlCatalogSetDebug() allows to generate debug messages
(through the xmlGenericError() mechanism).</p><h4>Querying routines:</h4><p>xmlCatalogResolve(), xmlCatalogResolveSystem(), xmlCatalogResolvePublic()
and xmlCatalogResolveURI() are relatively explicit if you read the XML
Catalog specification they correspond to section 7 algorithms, they should
also work if you have loaded an SGML catalog with a simplified semantic.</p><p>xmlCatalogLocalResolve() and xmlCatalogLocalResolveURI() are the same but
operate on the document catalog list</p><h4>Cleanup and Miscellaneous:</h4><p>xmlCatalogCleanup() free-up the global catalog, xmlCatalogFreeLocal() is
the per-document equivalent.</p><p>xmlCatalogAdd() and xmlCatalogRemove() are used to dynamically modify the
first catalog in the global list, and xmlCatalogDump() allows to dump a
catalog state, those routines are primarily designed for xmlcatalog, I'm not
sure that exposing more complex interfaces (like navigation ones) would be
really useful.</p><p>The xmlParseCatalogFile() is a function used to load XML Catalog files,
it's similar as xmlParseFile() except it bypass all catalog lookups, it's
provided because this functionality may be useful for client tools.</p><h4>threaded environments:</h4><p>Since the catalog tree is built progressively, some care has been taken to
try to avoid troubles in multithreaded environments. The code is now thread
safe assuming that the libxml2 library has been compiled with threads
support.</p><p></p><h3><a name="Other" id="Other">Other resources</a></h3><p>The XML Catalog specification is relatively recent so there isn't much
literature to point at:</p><ul><li>You can find a good rant from Norm Walsh about <a href="http://www.arbortext.com/Think_Tank/XML_Resources/Issue_Three/issue_three.html">the
need for catalogs</a>, it provides a lot of context informations even if
I don't agree with everything presented. Norm also wrote a more recent
article <a href="http://wwws.sun.com/software/xml/developers/resolver/article/">XML
entities and URI resolvers</a> describing them.</li>
<li>An <a href="http://home.ccil.org/~cowan/XML/XCatalog.html">old XML
catalog proposal</a> from John Cowan</li>
<li>The <a href="http://www.rddl.org/">Resource Directory Description
Language</a> (RDDL) another catalog system but more oriented toward
providing metadata for XML namespaces.</li>
<li>the page from the OASIS Technical <a href="http://www.oasis-open.org/committees/entity/">Committee on Entity
Resolution</a> who maintains XML Catalog, you will find pointers to the
specification update, some background and pointers to others tools
providing XML Catalog support</li>
<li>There is a <a href="buildDocBookCatalog">shell script</a> to generate
XML Catalogs for DocBook 4.1.2 . If it can write to the /etc/xml/
directory, it will set-up /etc/xml/catalog and /etc/xml/docbook based on
the resources found on the system. Otherwise it will just create
~/xmlcatalog and ~/dbkxmlcatalog and doing:
<p><code>export XML_CATALOG_FILES=$HOME/xmlcatalog</code></p>
<p>should allow to process DocBook documentations without requiring
network accesses for the DTD or stylesheets</p>
</li>
<li>I have uploaded <a href="ftp://xmlsoft.org/test/dbk412catalog.tar.gz">a
small tarball</a> containing XML Catalogs for DocBook 4.1.2 which seems
to work fine for me too</li>
<li>The <a href="http://www.xmlsoft.org/xmlcatalog_man.html">xmlcatalog
manual page</a></li>
</ul><p>If you have suggestions for corrections or additions, simply contact
me:</p><p><a href="bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css">
TD {font-family: Verdana,Arial,Helvetica}
BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
H1 {font-family: Verdana,Arial,Helvetica}
H2 {font-family: Verdana,Arial,Helvetica}
H3 {font-family: Verdana,Arial,Helvetica}
A:link, A:visited, A:active { text-decoration: underline }
</style><title>Contributions</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1>The XML C parser and toolkit of Gnome</h1><h2>Contributions</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Main Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a href="index.html">Home</a></li><li><a href="http://xmlsoft.org/wiki">Wiki</a></li><li><a href="html/index.html">Reference Manual</a></li><li><a href="intro.html">Introduction</a></li><li><a href="FAQ.html">FAQ</a></li><li><a href="docs.html" style="font-weight:bold">Developer Menu</a></li><li><a href="bugs.html">Reporting bugs and getting help</a></li><li><a href="help.html">How to help</a></li><li><a href="downloads.html">Downloads</a></li><li><a href="news.html">Releases</a></li><li><a href="XMLinfo.html">XML</a></li><li><a href="XSLT.html">XSLT</a></li><li><a href="xmldtd.html">Validation &amp; DTDs</a></li><li><a href="encoding.html">Encodings support</a></li><li><a href="catalog.html">Catalog support</a></li><li><a href="namespaces.html">Namespaces</a></li><li><a href="contribs.html">Contributions</a></li><li><a href="examples/index.html" style="font-weight:bold">Code Examples</a></li><li><a href="html/index.html" style="font-weight:bold">API Menu</a></li><li><a href="guidelines.html">XML Guidelines</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://www.blastwave.org/packages.php/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://rubyforge.org/projects/xml-tools/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><ul><li>Bjorn Reese, William Brack and Thomas Broyer have provided a number of
patches, Gary Pennington worked on the validation API, threading support
and Solaris port.</li>
<li>John Fleck helps maintaining the documentation and man pages.</li>
<li><a href="mailto:igor@zlatkovic.com">Igor Zlatkovic</a> is now the
maintainer of the Windows port, <a href="http://www.zlatkovic.com/projects/libxml/index.html">he provides
binaries</a></li>
<li><a href="mailto:Gary.Pennington@sun.com">Gary Pennington</a> provides
<a href="http://garypennington.net/libxml2/">Solaris binaries</a></li>
<li><a href="http://mail.gnome.org/archives/xml/2001-March/msg00014.html">Matt
Sergeant</a> developed <a href="http://axkit.org/download/">XML::LibXSLT</a>, a Perl wrapper for
libxml2/libxslt as part of the <a href="http://axkit.com/">AxKit XML
application server</a></li>
<li><a href="mailto:fnatter@gmx.net">Felix Natter</a> and <a href="mailto:geertk@ai.rug.nl">Geert Kloosterman</a> provide <a href="libxml-doc.el">an emacs module</a> to lookup libxml(2) functions
documentation</li>
<li><a href="mailto:sherwin@nlm.nih.gov">Ziying Sherwin</a> provided <a href="http://xmlsoft.org/messages/0488.html">man pages</a></li>
<li>there is a module for <a href="http://acs-misc.sourceforge.net/nsxml.html">libxml/libxslt support
in OpenNSD/AOLServer</a></li>
<li><a href="mailto:dkuhlman@cutter.rexx.com">Dave Kuhlman</a> provided the
first version of libxml/libxslt <a href="http://www.rexx.com/~dkuhlman">wrappers for Python</a></li>
<li>Petr Kozelka provides <a href="http://sourceforge.net/projects/libxml2-pas">Pascal units to glue
libxml2</a> with Kylix and Delphi and other Pascal compilers</li>
<li><a href="mailto:aleksey@aleksey.com">Aleksey Sanin</a> implemented the
<a href="http://www.w3.org/Signature/">XML Canonicalization and XML
Digital Signature</a> <a href="http://www.aleksey.com/xmlsec/">implementations for libxml2</a></li>
<li><a href="mailto:Steve.Ball@explain.com.au">Steve Ball</a>
and contributors maintain <a href="http://tclxml.sourceforge.net/">tcl bindings for libxml2 and
libxslt</a>, as well as <a href="http://tclxml.sf.net/tkxmllint.html">tkxmllint</a> a GUI for
xmllint and <a href="http://tclxml.sf.net/tkxsltproc.html">tkxsltproc</a>
a GUI for xsltproc.</li>
</ul><p></p><p><a href="bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css">
TD {font-family: Verdana,Arial,Helvetica}
BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
H1 {font-family: Verdana,Arial,Helvetica}
H2 {font-family: Verdana,Arial,Helvetica}
H3 {font-family: Verdana,Arial,Helvetica}
A:link, A:visited, A:active { text-decoration: underline }
</style><title>Downloads</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1>The XML C parser and toolkit of Gnome</h1><h2>Downloads</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Main Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a href="index.html">Home</a></li><li><a href="http://xmlsoft.org/wiki">Wiki</a></li><li><a href="html/index.html">Reference Manual</a></li><li><a href="intro.html">Introduction</a></li><li><a href="FAQ.html">FAQ</a></li><li><a href="docs.html" style="font-weight:bold">Developer Menu</a></li><li><a href="bugs.html">Reporting bugs and getting help</a></li><li><a href="help.html">How to help</a></li><li><a href="downloads.html">Downloads</a></li><li><a href="news.html">Releases</a></li><li><a href="XMLinfo.html">XML</a></li><li><a href="XSLT.html">XSLT</a></li><li><a href="xmldtd.html">Validation &amp; DTDs</a></li><li><a href="encoding.html">Encodings support</a></li><li><a href="catalog.html">Catalog support</a></li><li><a href="namespaces.html">Namespaces</a></li><li><a href="contribs.html">Contributions</a></li><li><a href="examples/index.html" style="font-weight:bold">Code Examples</a></li><li><a href="html/index.html" style="font-weight:bold">API Menu</a></li><li><a href="guidelines.html">XML Guidelines</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://www.blastwave.org/packages.php/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://rubyforge.org/projects/xml-tools/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><p>The latest versions of libxml2 can be found on the <a href="ftp://xmlsoft.org/">xmlsoft.org</a> server ( <a href="http://xmlsoft.org/sources/">HTTP</a>, <a href="ftp://xmlsoft.org/">FTP</a> and rsync are available), there is also
mirrors (<a href="ftp://ftp.planetmirror.com/pub/xmlsoft/">Australia</a>( <a href="http://xmlsoft.planetmirror.com/">Web</a>), <a href="ftp://fr.rpmfind.net/pub/libxml/">France</a>) or on the <a href="ftp://ftp.gnome.org/pub/GNOME/MIRRORS.html">Gnome FTP server</a> as <a href="ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/">source archive</a>
, Antonin Sprinzl also provide <a href="ftp://gd.tuwien.ac.at/pub/libxml/">a
mirror in Austria</a>. (NOTE that you need both the <a href="http://rpmfind.net/linux/RPM/libxml2.html">libxml(2)</a> and <a href="http://rpmfind.net/linux/RPM/libxml2-devel.html">libxml(2)-devel</a>
packages installed to compile applications using libxml.)</p><p>You can find all the history of libxml(2) and libxslt releases in the <a href="http://xmlsoft.org/sources/old/">old</a> directory. The precompiled
Windows binaries made by Igor Zlatovic are available in the <a href="http://xmlsoft.org/sources/win32/">win32</a> directory.</p><p>Binary ports:</p><ul><li>Red Hat RPMs for i386 are available directly on <a href="ftp://xmlsoft.org/">xmlsoft.org</a>, the source RPM will compile on
any architecture supported by Red Hat.</li>
<li><a href="mailto:igor@zlatkovic.com">Igor Zlatkovic</a> is now the
maintainer of the Windows port, <a href="http://www.zlatkovic.com/projects/libxml/index.html">he provides
binaries</a>.</li>
<li>Blastwave provides
<a href="http://www.blastwave.org/packages.php/libxml2">Solaris binaries</a>.</li>
<li><a href="mailto:Steve.Ball@explain.com.au">Steve Ball</a> provides <a href="http://www.explain.com.au/oss/libxml2xslt.html">Mac Os X
binaries</a>.</li>
<li>The HP-UX porting center provides <a href="http://hpux.connect.org.uk/hppd/hpux/Gnome/">HP-UX binaries</a></li>
</ul><p>If you know other supported binary ports, please <a href="http://veillard.com/">contact me</a>.</p><p><a name="Snapshot" id="Snapshot">Snapshot:</a></p><ul><li>Code from the W3C cvs base libxml2 module, updated hourly <a href="ftp://xmlsoft.org/libxml2-cvs-snapshot.tar.gz">libxml2-cvs-snapshot.tar.gz</a>.</li>
<li>Docs, content of the web site, the list archive included <a href="ftp://xmlsoft.org/libxml-docs.tar.gz">libxml-docs.tar.gz</a>.</li>
</ul><p><a name="Contribs" id="Contribs">Contributions:</a></p><p>I do accept external contributions, especially if compiling on another
platform, get in touch with the list to upload the package, wrappers for
various languages have been provided, and can be found in the <a href="python.html">bindings section</a></p><p>Libxml2 is also available from CVS:</p><ul><li><p>The <a href="http://cvs.gnome.org/viewcvs/libxml2/">Gnome CVS
base</a>. Check the <a href="http://developer.gnome.org/tools/cvs.html">Gnome CVS Tools</a>
page; the CVS module is <b>libxml2</b>.</p>
</li>
<li>The <strong>libxslt</strong> module is also present there</li>
</ul><p><a href="bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>

View file

@ -0,0 +1,159 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
version="1.0">
<xsl:output method="text" encoding="ISO-8859-1"/>
<xsl:template match="/">
<xsl:text>/*
* elfgcchack.h: hack by Arjan van de Ven &lt;arjanv@redhat.com&gt; to speed
* up the code when using gcc for call within the library.
*
* Based on the analysis http://people.redhat.com/drepper/dsohowto.pdf
* from Ulrich drepper. Rewritten to be generated from the XML description
* file for libxml2 API
* autogenerated with xsltproc doc/elfgcchack.xsl doc/libxml2-api.xml
*/
#ifdef IN_LIBXML
#ifdef __GNUC__
#ifdef PIC
#ifdef linux
#if (__GNUC__ == 3 &amp;&amp; __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
#include "libxml/c14n.h"
#include "libxml/catalog.h"
#include "libxml/chvalid.h"
#include "libxml/debugXML.h"
#include "libxml/dict.h"
#include "libxml/DOCBparser.h"
#include "libxml/encoding.h"
#include "libxml/entities.h"
#include "libxml/globals.h"
#include "libxml/hash.h"
#include "libxml/HTMLparser.h"
#include "libxml/HTMLtree.h"
#include "libxml/list.h"
#include "libxml/nanoftp.h"
#include "libxml/nanohttp.h"
#include "libxml/parser.h"
#include "libxml/parserInternals.h"
#include "libxml/pattern.h"
#include "libxml/relaxng.h"
#include "libxml/SAX2.h"
#include "libxml/SAX.h"
#include "libxml/schemasInternals.h"
#include "libxml/threads.h"
#include "libxml/tree.h"
#include "libxml/uri.h"
#include "libxml/valid.h"
#include "libxml/xinclude.h"
#include "libxml/xlink.h"
#include "libxml/xmlautomata.h"
#include "libxml/xmlerror.h"
#include "libxml/xmlexports.h"
#include "libxml/xmlIO.h"
#include "libxml/xmlmemory.h"
#include "libxml/xmlreader.h"
#include "libxml/xmlregexp.h"
#include "libxml/xmlsave.h"
#include "libxml/xmlschemas.h"
#include "libxml/xmlschemastypes.h"
#include "libxml/xmlstring.h"
#include "libxml/xmlunicode.h"
#include "libxml/xmlversion.h"
#include "libxml/xmlwriter.h"
#include "libxml/xpath.h"
#include "libxml/xpathInternals.h"
#include "libxml/xpointer.h"
#include "libxml/xmlmodule.h"
/* special hot spot not exported ones */
#ifdef bottom_globals
#undef __xmlGenericError
extern __typeof (__xmlGenericError) __xmlGenericError __attribute((alias("__xmlGenericError__internal_alias")));
#else
#ifndef __xmlGenericError
extern __typeof (__xmlGenericError) __xmlGenericError__internal_alias __attribute((visibility("hidden")));
#define __xmlGenericError __xmlGenericError__internal_alias
#endif
#endif
#ifdef bottom_globals
#undef __xmlGenericErrorContext
extern __typeof (__xmlGenericErrorContext) __xmlGenericErrorContext __attribute((alias("__xmlGenericErrorContext__internal_alias")));
#else
#ifndef __xmlGenericErrorContext
extern __typeof (__xmlGenericErrorContext) __xmlGenericErrorContext__internal_alias __attribute((visibility("hidden")));
#define __xmlGenericErrorContext __xmlGenericErrorContext__internal_alias
#endif
#endif
/* list generated from libxml2-api.xml */
</xsl:text>
<xsl:apply-templates select="/api/symbols/function"/>
<xsl:text>
#endif
#endif
#endif
#endif
#endif
</xsl:text>
</xsl:template>
<xsl:template match="function">
<xsl:variable name="str" select="string(@name)"/>
<xsl:if test="starts-with(@name, 'xml') or starts-with(@name, 'html') or contains(@name, 'Push') or contains(@name, 'Pop')">
<xsl:variable name="alias" select="concat($str, '__internal_alias')"/>
<xsl:apply-templates select="cond"/>
<xsl:text>#ifdef bottom_</xsl:text>
<xsl:value-of select="string(@module)"/>
<xsl:text>
#undef </xsl:text>
<xsl:value-of select="$str"/>
<xsl:text>
extern __typeof (</xsl:text>
<xsl:value-of select="$str"/>
<xsl:text>) </xsl:text>
<xsl:value-of select="$str"/>
<xsl:text> __attribute((alias("</xsl:text>
<xsl:value-of select="$alias"/>
<xsl:text>")));
#else
#ifndef </xsl:text>
<xsl:value-of select="$str"/>
<xsl:text>
</xsl:text>
<xsl:text>extern __typeof (</xsl:text>
<xsl:value-of select="$str"/>
<xsl:text>) </xsl:text>
<xsl:value-of select="$alias"/>
<xsl:text> __attribute((visibility("hidden")));
</xsl:text>
<xsl:text>#define </xsl:text>
<xsl:value-of select="$str"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$alias"/>
<xsl:text>
#endif
#endif
</xsl:text>
<xsl:apply-templates select="cond" mode="end"/>
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="cond">
<xsl:text>#if </xsl:text>
<xsl:value-of select="."/>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="cond" mode="end">
<xsl:text>#endif
</xsl:text>
</xsl:template>
</xsl:stylesheet>

View file

@ -0,0 +1,215 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css">
TD {font-family: Verdana,Arial,Helvetica}
BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
H1 {font-family: Verdana,Arial,Helvetica}
H2 {font-family: Verdana,Arial,Helvetica}
H3 {font-family: Verdana,Arial,Helvetica}
A:link, A:visited, A:active { text-decoration: underline }
</style><title>Encodings support</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1>The XML C parser and toolkit of Gnome</h1><h2>Encodings support</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Main Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a href="index.html">Home</a></li><li><a href="http://xmlsoft.org/wiki">Wiki</a></li><li><a href="html/index.html">Reference Manual</a></li><li><a href="intro.html">Introduction</a></li><li><a href="FAQ.html">FAQ</a></li><li><a href="docs.html" style="font-weight:bold">Developer Menu</a></li><li><a href="bugs.html">Reporting bugs and getting help</a></li><li><a href="help.html">How to help</a></li><li><a href="downloads.html">Downloads</a></li><li><a href="news.html">Releases</a></li><li><a href="XMLinfo.html">XML</a></li><li><a href="XSLT.html">XSLT</a></li><li><a href="xmldtd.html">Validation &amp; DTDs</a></li><li><a href="encoding.html">Encodings support</a></li><li><a href="catalog.html">Catalog support</a></li><li><a href="namespaces.html">Namespaces</a></li><li><a href="contribs.html">Contributions</a></li><li><a href="examples/index.html" style="font-weight:bold">Code Examples</a></li><li><a href="html/index.html" style="font-weight:bold">API Menu</a></li><li><a href="guidelines.html">XML Guidelines</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://www.blastwave.org/packages.php/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://rubyforge.org/projects/xml-tools/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><p>If you are not really familiar with Internationalization (usual shortcut
is I18N) , Unicode, characters and glyphs, I suggest you read a <a href="http://www.tbray.org/ongoing/When/200x/2003/04/06/Unicode">presentation</a>
by Tim Bray on Unicode and why you should care about it.</p><p>If you don't understand why <b>it does not make sense to have a string
without knowing what encoding it uses</b>, then as Joel Spolsky said
<a href="http://www.joelonsoftware.com/articles/Unicode.html">please do
not write another line of code until you finish reading that article.</a>.
It is a prerequisite to understand this page, and avoid a lot of problems
with libxml2, XML or text processing in general.</p><p>Table of Content:</p><ol><li><a href="encoding.html#What">What does internationalization support
mean ?</a></li>
<li><a href="encoding.html#internal">The internal encoding, how and
why</a></li>
<li><a href="encoding.html#implemente">How is it implemented ?</a></li>
<li><a href="encoding.html#Default">Default supported encodings</a></li>
<li><a href="encoding.html#extend">How to extend the existing
support</a></li>
</ol><h3><a name="What" id="What">What does internationalization support mean ?</a></h3><p>XML was designed from the start to allow the support of any character set
by using Unicode. Any conformant XML parser has to support the UTF-8 and
UTF-16 default encodings which can both express the full unicode ranges. UTF8
is a variable length encoding whose greatest points are to reuse the same
encoding for ASCII and to save space for Western encodings, but it is a bit
more complex to handle in practice. UTF-16 use 2 bytes per character (and
sometimes combines two pairs), it makes implementation easier, but looks a
bit overkill for Western languages encoding. Moreover the XML specification
allows the document to be encoded in other encodings at the condition that
they are clearly labeled as such. For example the following is a wellformed
XML document encoded in ISO-8859-1 and using accentuated letters that we
French like for both markup and content:</p><pre>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
&lt;très&gt;&lt;/très&gt;</pre><p>Having internationalization support in libxml2 means the following:</p><ul><li>the document is properly parsed</li>
<li>informations about it's encoding are saved</li>
<li>it can be modified</li>
<li>it can be saved in its original encoding</li>
<li>it can also be saved in another encoding supported by libxml2 (for
example straight UTF8 or even an ASCII form)</li>
</ul><p>Another very important point is that the whole libxml2 API, with the
exception of a few routines to read with a specific encoding or save to a
specific encoding, is completely agnostic about the original encoding of the
document.</p><p>It should be noted too that the HTML parser embedded in libxml2 now obey
the same rules too, the following document will be (as of 2.2.2) handled in
an internationalized fashion by libxml2 too:</p><pre>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd"&gt;
&lt;html lang="fr"&gt;
&lt;head&gt;
&lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;W3C crée des standards pour le Web.&lt;/body&gt;
&lt;/html&gt;</pre><h3><a name="internal" id="internal">The internal encoding, how and why</a></h3><p>One of the core decisions was to force all documents to be converted to a
default internal encoding, and that encoding to be UTF-8, here are the
rationales for those choices:</p><ul><li>keeping the native encoding in the internal form would force the libxml
users (or the code associated) to be fully aware of the encoding of the
original document, for examples when adding a text node to a document,
the content would have to be provided in the document encoding, i.e. the
client code would have to check it before hand, make sure it's conformant
to the encoding, etc ... Very hard in practice, though in some specific
cases this may make sense.</li>
<li>the second decision was which encoding. From the XML spec only UTF8 and
UTF16 really makes sense as being the two only encodings for which there
is mandatory support. UCS-4 (32 bits fixed size encoding) could be
considered an intelligent choice too since it's a direct Unicode mapping
support. I selected UTF-8 on the basis of efficiency and compatibility
with surrounding software:
<ul><li>UTF-8 while a bit more complex to convert from/to (i.e. slightly
more costly to import and export CPU wise) is also far more compact
than UTF-16 (and UCS-4) for a majority of the documents I see it used
for right now (RPM RDF catalogs, advogato data, various configuration
file formats, etc.) and the key point for today's computer
architecture is efficient uses of caches. If one nearly double the
memory requirement to store the same amount of data, this will trash
caches (main memory/external caches/internal caches) and my take is
that this harms the system far more than the CPU requirements needed
for the conversion to UTF-8</li>
<li>Most of libxml2 version 1 users were using it with straight ASCII
most of the time, doing the conversion with an internal encoding
requiring all their code to be rewritten was a serious show-stopper
for using UTF-16 or UCS-4.</li>
<li>UTF-8 is being used as the de-facto internal encoding standard for
related code like the <a href="http://www.pango.org/">pango</a>
upcoming Gnome text widget, and a lot of Unix code (yet another place
where Unix programmer base takes a different approach from Microsoft
- they are using UTF-16)</li>
</ul></li>
</ul><p>What does this mean in practice for the libxml2 user:</p><ul><li>xmlChar, the libxml2 data type is a byte, those bytes must be assembled
as UTF-8 valid strings. The proper way to terminate an xmlChar * string
is simply to append 0 byte, as usual.</li>
<li>One just need to make sure that when using chars outside the ASCII set,
the values has been properly converted to UTF-8</li>
</ul><h3><a name="implemente" id="implemente">How is it implemented ?</a></h3><p>Let's describe how all this works within libxml, basically the I18N
(internationalization) support get triggered only during I/O operation, i.e.
when reading a document or saving one. Let's look first at the reading
sequence:</p><ol><li>when a document is processed, we usually don't know the encoding, a
simple heuristic allows to detect UTF-16 and UCS-4 from encodings where
the ASCII range (0-0x7F) maps with ASCII</li>
<li>the xml declaration if available is parsed, including the encoding
declaration. At that point, if the autodetected encoding is different
from the one declared a call to xmlSwitchEncoding() is issued.</li>
<li>If there is no encoding declaration, then the input has to be in either
UTF-8 or UTF-16, if it is not then at some point when processing the
input, the converter/checker of UTF-8 form will raise an encoding error.
You may end-up with a garbled document, or no document at all ! Example:
<pre>~/XML -&gt; ./xmllint err.xml
err.xml:1: error: Input is not proper UTF-8, indicate encoding !
&lt;très&gt;&lt;/très&gt;
^
err.xml:1: error: Bytes: 0xE8 0x73 0x3E 0x6C
&lt;très&gt;&lt;/très&gt;
^</pre>
</li>
<li>xmlSwitchEncoding() does an encoding name lookup, canonicalize it, and
then search the default registered encoding converters for that encoding.
If it's not within the default set and iconv() support has been compiled
it, it will ask iconv for such an encoder. If this fails then the parser
will report an error and stops processing:
<pre>~/XML -&gt; ./xmllint err2.xml
err2.xml:1: error: Unsupported encoding UnsupportedEnc
&lt;?xml version="1.0" encoding="UnsupportedEnc"?&gt;
^</pre>
</li>
<li>From that point the encoder processes progressively the input (it is
plugged as a front-end to the I/O module) for that entity. It captures
and converts on-the-fly the document to be parsed to UTF-8. The parser
itself just does UTF-8 checking of this input and process it
transparently. The only difference is that the encoding information has
been added to the parsing context (more precisely to the input
corresponding to this entity).</li>
<li>The result (when using DOM) is an internal form completely in UTF-8
with just an encoding information on the document node.</li>
</ol><p>Ok then what happens when saving the document (assuming you
collected/built an xmlDoc DOM like structure) ? It depends on the function
called, xmlSaveFile() will just try to save in the original encoding, while
xmlSaveFileTo() and xmlSaveFileEnc() can optionally save to a given
encoding:</p><ol><li>if no encoding is given, libxml2 will look for an encoding value
associated to the document and if it exists will try to save to that
encoding,
<p>otherwise everything is written in the internal form, i.e. UTF-8</p>
</li>
<li>so if an encoding was specified, either at the API level or on the
document, libxml2 will again canonicalize the encoding name, lookup for a
converter in the registered set or through iconv. If not found the
function will return an error code</li>
<li>the converter is placed before the I/O buffer layer, as another kind of
buffer, then libxml2 will simply push the UTF-8 serialization to through
that buffer, which will then progressively be converted and pushed onto
the I/O layer.</li>
<li>It is possible that the converter code fails on some input, for example
trying to push an UTF-8 encoded Chinese character through the UTF-8 to
ISO-8859-1 converter won't work. Since the encoders are progressive they
will just report the error and the number of bytes converted, at that
point libxml2 will decode the offending character, remove it from the
buffer and replace it with the associated charRef encoding &amp;#123; and
resume the conversion. This guarantees that any document will be saved
without losses (except for markup names where this is not legal, this is
a problem in the current version, in practice avoid using non-ascii
characters for tag or attribute names). A special "ascii" encoding name
is used to save documents to a pure ascii form can be used when
portability is really crucial</li>
</ol><p>Here are a few examples based on the same test document:</p><pre>~/XML -&gt; ./xmllint isolat1
&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
&lt;très&gt;&lt;/très&gt;
~/XML -&gt; ./xmllint --encode UTF-8 isolat1
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;très&gt; &lt;/très&gt;
~/XML -&gt; </pre><p>The same processing is applied (and reuse most of the code) for HTML I18N
processing. Looking up and modifying the content encoding is a bit more
difficult since it is located in a &lt;meta&gt; tag under the &lt;head&gt;,
so a couple of functions htmlGetMetaEncoding() and htmlSetMetaEncoding() have
been provided. The parser also attempts to switch encoding on the fly when
detecting such a tag on input. Except for that the processing is the same
(and again reuses the same code).</p><h3><a name="Default" id="Default">Default supported encodings</a></h3><p>libxml2 has a set of default converters for the following encodings
(located in encoding.c):</p><ol><li>UTF-8 is supported by default (null handlers)</li>
<li>UTF-16, both little and big endian</li>
<li>ISO-Latin-1 (ISO-8859-1) covering most western languages</li>
<li>ASCII, useful mostly for saving</li>
<li>HTML, a specific handler for the conversion of UTF-8 to ASCII with HTML
predefined entities like &amp;copy; for the Copyright sign.</li>
</ol><p>More over when compiled on an Unix platform with iconv support the full
set of encodings supported by iconv can be instantly be used by libxml. On a
linux machine with glibc-2.1 the list of supported encodings and aliases fill
3 full pages, and include UCS-4, the full set of ISO-Latin encodings, and the
various Japanese ones.</p><h4>Encoding aliases</h4><p>From 2.2.3, libxml2 has support to register encoding names aliases. The
goal is to be able to parse document whose encoding is supported but where
the name differs (for example from the default set of names accepted by
iconv). The following functions allow to register and handle new aliases for
existing encodings. Once registered libxml2 will automatically lookup the
aliases when handling a document:</p><ul><li>int xmlAddEncodingAlias(const char *name, const char *alias);</li>
<li>int xmlDelEncodingAlias(const char *alias);</li>
<li>const char * xmlGetEncodingAlias(const char *alias);</li>
<li>void xmlCleanupEncodingAliases(void);</li>
</ul><h3><a name="extend" id="extend">How to extend the existing support</a></h3><p>Well adding support for new encoding, or overriding one of the encoders
(assuming it is buggy) should not be hard, just write input and output
conversion routines to/from UTF-8, and register them using
xmlNewCharEncodingHandler(name, xxxToUTF8, UTF8Toxxx), and they will be
called automatically if the parser(s) encounter such an encoding name
(register it uppercase, this will help). The description of the encoders,
their arguments and expected return values are described in the encoding.h
header.</p><p>A quick note on the topic of subverting the parser to use a different
internal encoding than UTF-8, in some case people will absolutely want to
keep the internal encoding different, I think it's still possible (but the
encoding must be compliant with ASCII on the same subrange) though I didn't
tried it. The key is to override the default conversion routines (by
registering null encoders/decoders for your charsets), and bypass the UTF-8
checking of the parser by setting the parser context charset
(ctxt-&gt;charset) to something different than XML_CHAR_ENCODING_UTF8, but
there is no guarantee that this will work. You may also have some troubles
saving back.</p><p>Basically proper I18N support is important, this requires at least
libxml-2.0.0, but a lot of features and corrections are really available only
starting 2.2.</p><p><a href="bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show more