mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
cleanup, creating a new legacy.c module, made sure make tests ran in
* Makefile.am: cleanup, creating a new legacy.c module, made sure make tests ran in reduced conditions * SAX.c SAX2.c configure.in entities.c globals.c parser.c parserInternals.c tree.c valid.c xlink.c xmlIO.c xmlcatalog.c xmlmemory.c xpath.c xmlmemory.c include/libxml/xmlversion.h.in: increased the modularization, allow to configure out validation code and legacy code, added a configuration option --with-minimum compiling only the mandatory code which then shrink to 200KB. Daniel
This commit is contained in:
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
|||||||
|
Sun Sep 28 20:53:17 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* Makefile.am: cleanup, creating a new legacy.c module,
|
||||||
|
made sure make tests ran in reduced conditions
|
||||||
|
* SAX.c SAX2.c configure.in entities.c globals.c parser.c
|
||||||
|
parserInternals.c tree.c valid.c xlink.c xmlIO.c xmlcatalog.c
|
||||||
|
xmlmemory.c xpath.c xmlmemory.c include/libxml/xmlversion.h.in:
|
||||||
|
increased the modularization, allow to configure out
|
||||||
|
validation code and legacy code, added a configuration
|
||||||
|
option --with-minimum compiling only the mandatory code
|
||||||
|
which then shrink to 200KB.
|
||||||
|
|
||||||
Sun Sep 28 02:15:07 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
Sun Sep 28 02:15:07 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* parser.c: fix a bug raised by the Mips compiler.
|
* parser.c: fix a bug raised by the Mips compiler.
|
||||||
|
12
Makefile.am
12
Makefile.am
@ -26,7 +26,8 @@ libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
|
|||||||
xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \
|
xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \
|
||||||
catalog.c globals.c threads.c c14n.c \
|
catalog.c globals.c threads.c c14n.c \
|
||||||
xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
|
xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
|
||||||
triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c
|
triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c \
|
||||||
|
legacy.c
|
||||||
else
|
else
|
||||||
libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
|
libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
|
||||||
parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
|
parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
|
||||||
@ -34,7 +35,8 @@ libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
|
|||||||
xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \
|
xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \
|
||||||
catalog.c globals.c threads.c c14n.c \
|
catalog.c globals.c threads.c c14n.c \
|
||||||
xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
|
xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
|
||||||
xmlreader.c relaxng.c dict.c SAX2.c
|
xmlreader.c relaxng.c dict.c SAX2.c \
|
||||||
|
legacy.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DEPS = $(top_builddir)/libxml2.la
|
DEPS = $(top_builddir)/libxml2.la
|
||||||
@ -120,7 +122,7 @@ check-local: tests
|
|||||||
|
|
||||||
testall : tests SVGtests SAXtests
|
testall : tests SVGtests SAXtests
|
||||||
|
|
||||||
tests: XMLtests XMLenttests NStests Readertests SAXtests HTMLtests Validtests URItests XPathtests XPtrtests XIncludetests C14Ntests Scripttests Catatests @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_THREADS@ Timingtests
|
tests: XMLtests XMLenttests NStests Readertests SAXtests @TEST_HTML@ @TEST_VALID@ URItests @TEST_XPATH@ @TEST_XPTR@ @TEST_XINCLUDE@ @TEST_C14N@ @TEST_DEBUG@ @TEST_CATALOG@ @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_THREADS@ Timingtests @TEST_VTIME@
|
||||||
@(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; $(MAKE) tests ; fi)
|
@(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; $(MAKE) tests ; fi)
|
||||||
|
|
||||||
valgrind:
|
valgrind:
|
||||||
@ -720,7 +722,7 @@ $(srcdir)/dba100000.xml: dbgenattr.pl
|
|||||||
@echo "## generating dba100000.xml"
|
@echo "## generating dba100000.xml"
|
||||||
@(dbgenattr.pl 100000 > $(srcdir)/dba100000.xml)
|
@(dbgenattr.pl 100000 > $(srcdir)/dba100000.xml)
|
||||||
|
|
||||||
Timingtests: $(srcdir)/dba100000.xml
|
Timingtests: xmllint$(EXEEXT) $(srcdir)/dba100000.xml
|
||||||
@echo "##"
|
@echo "##"
|
||||||
@echo "## Timing tests to try to detect performance"
|
@echo "## Timing tests to try to detect performance"
|
||||||
@echo "## as well a memory usage breakage when streaming"
|
@echo "## as well a memory usage breakage when streaming"
|
||||||
@ -744,6 +746,8 @@ Timingtests: $(srcdir)/dba100000.xml
|
|||||||
if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
|
if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
|
||||||
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
|
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
|
||||||
exit 0)
|
exit 0)
|
||||||
|
|
||||||
|
VTimingtests: xmllint$(EXEEXT)
|
||||||
-@(xmllint --noout --timing --valid --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
|
-@(xmllint --noout --timing --valid --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
|
||||||
MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
|
MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
|
||||||
if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
|
if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
|
||||||
|
583
SAX.c
583
SAX.c
@ -28,589 +28,6 @@
|
|||||||
#include <libxml/globals.h>
|
#include <libxml/globals.h>
|
||||||
#include <libxml/SAX2.h>
|
#include <libxml/SAX2.h>
|
||||||
|
|
||||||
/* #define DEBUG_SAX */
|
|
||||||
/* #define DEBUG_SAX_TREE */
|
|
||||||
|
|
||||||
static int deprecated_msg = 0;
|
|
||||||
|
|
||||||
#define DEPRECATED(n) \
|
|
||||||
if (deprecated_msg == 0) \
|
|
||||||
xmlGenericError(xmlGenericErrorContext, \
|
|
||||||
"Use of deprecated SAXv1 function %s\n", n); \
|
|
||||||
deprecated_msg++;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getPublicId:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
*
|
|
||||||
* Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"
|
|
||||||
* DEPRECATED: use xmlSAX2GetPublicId()
|
|
||||||
*
|
|
||||||
* Returns a xmlChar *
|
|
||||||
*/
|
|
||||||
const xmlChar *
|
|
||||||
getPublicId(void *ctx)
|
|
||||||
{
|
|
||||||
DEPRECATED("getPublicId")
|
|
||||||
return(xmlSAX2GetPublicId(ctx));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getSystemId:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
*
|
|
||||||
* Provides the system ID, basically URL or filename e.g.
|
|
||||||
* http://www.sgmlsource.com/dtds/memo.dtd
|
|
||||||
* DEPRECATED: use xmlSAX2GetSystemId()
|
|
||||||
*
|
|
||||||
* Returns a xmlChar *
|
|
||||||
*/
|
|
||||||
const xmlChar *
|
|
||||||
getSystemId(void *ctx)
|
|
||||||
{
|
|
||||||
DEPRECATED("getSystemId")
|
|
||||||
return(xmlSAX2GetSystemId(ctx));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getLineNumber:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
*
|
|
||||||
* Provide the line number of the current parsing point.
|
|
||||||
* DEPRECATED: use xmlSAX2GetLineNumber()
|
|
||||||
*
|
|
||||||
* Returns an int
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
getLineNumber(void *ctx)
|
|
||||||
{
|
|
||||||
DEPRECATED("getLineNumber")
|
|
||||||
return(xmlSAX2GetLineNumber(ctx));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getColumnNumber:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
*
|
|
||||||
* Provide the column number of the current parsing point.
|
|
||||||
* DEPRECATED: use xmlSAX2GetColumnNumber()
|
|
||||||
*
|
|
||||||
* Returns an int
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
getColumnNumber(void *ctx)
|
|
||||||
{
|
|
||||||
DEPRECATED("getColumnNumber")
|
|
||||||
return(xmlSAX2GetColumnNumber(ctx));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* isStandalone:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
*
|
|
||||||
* Is this document tagged standalone ?
|
|
||||||
* DEPRECATED: use xmlSAX2IsStandalone()
|
|
||||||
*
|
|
||||||
* Returns 1 if true
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
isStandalone(void *ctx)
|
|
||||||
{
|
|
||||||
DEPRECATED("isStandalone")
|
|
||||||
return(xmlSAX2IsStandalone(ctx));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hasInternalSubset:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
*
|
|
||||||
* Does this document has an internal subset
|
|
||||||
* DEPRECATED: use xmlSAX2HasInternalSubset()
|
|
||||||
*
|
|
||||||
* Returns 1 if true
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
hasInternalSubset(void *ctx)
|
|
||||||
{
|
|
||||||
DEPRECATED("hasInternalSubset")
|
|
||||||
return(xmlSAX2HasInternalSubset(ctx));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hasExternalSubset:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
*
|
|
||||||
* Does this document has an external subset
|
|
||||||
* DEPRECATED: use xmlSAX2HasExternalSubset()
|
|
||||||
*
|
|
||||||
* Returns 1 if true
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
hasExternalSubset(void *ctx)
|
|
||||||
{
|
|
||||||
DEPRECATED("hasExternalSubset")
|
|
||||||
return(xmlSAX2HasExternalSubset(ctx));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* internalSubset:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @name: the root element name
|
|
||||||
* @ExternalID: the external ID
|
|
||||||
* @SystemID: the SYSTEM ID (e.g. filename or URL)
|
|
||||||
*
|
|
||||||
* Callback on internal subset declaration.
|
|
||||||
* DEPRECATED: use xmlSAX2InternalSubset()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
internalSubset(void *ctx, const xmlChar *name,
|
|
||||||
const xmlChar *ExternalID, const xmlChar *SystemID)
|
|
||||||
{
|
|
||||||
DEPRECATED("internalSubset")
|
|
||||||
xmlSAX2InternalSubset(ctx, name, ExternalID, SystemID);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* externalSubset:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @name: the root element name
|
|
||||||
* @ExternalID: the external ID
|
|
||||||
* @SystemID: the SYSTEM ID (e.g. filename or URL)
|
|
||||||
*
|
|
||||||
* Callback on external subset declaration.
|
|
||||||
* DEPRECATED: use xmlSAX2ExternalSubset()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
externalSubset(void *ctx, const xmlChar *name,
|
|
||||||
const xmlChar *ExternalID, const xmlChar *SystemID)
|
|
||||||
{
|
|
||||||
DEPRECATED("externalSubset")
|
|
||||||
xmlSAX2ExternalSubset(ctx, name, ExternalID, SystemID);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* resolveEntity:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @publicId: The public ID of the entity
|
|
||||||
* @systemId: The system ID of the entity
|
|
||||||
*
|
|
||||||
* The entity loader, to control the loading of external entities,
|
|
||||||
* the application can either:
|
|
||||||
* - override this resolveEntity() callback in the SAX block
|
|
||||||
* - or better use the xmlSetExternalEntityLoader() function to
|
|
||||||
* set up it's own entity resolution routine
|
|
||||||
* DEPRECATED: use xmlSAX2ResolveEntity()
|
|
||||||
*
|
|
||||||
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
|
|
||||||
*/
|
|
||||||
xmlParserInputPtr
|
|
||||||
resolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId)
|
|
||||||
{
|
|
||||||
DEPRECATED("resolveEntity")
|
|
||||||
return(xmlSAX2ResolveEntity(ctx, publicId, systemId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getEntity:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @name: The entity name
|
|
||||||
*
|
|
||||||
* Get an entity by name
|
|
||||||
* DEPRECATED: use xmlSAX2GetEntity()
|
|
||||||
*
|
|
||||||
* Returns the xmlEntityPtr if found.
|
|
||||||
*/
|
|
||||||
xmlEntityPtr
|
|
||||||
getEntity(void *ctx, const xmlChar *name)
|
|
||||||
{
|
|
||||||
DEPRECATED("getEntity")
|
|
||||||
return(xmlSAX2GetEntity(ctx, name));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getParameterEntity:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @name: The entity name
|
|
||||||
*
|
|
||||||
* Get a parameter entity by name
|
|
||||||
* DEPRECATED: use xmlSAX2GetParameterEntity()
|
|
||||||
*
|
|
||||||
* Returns the xmlEntityPtr if found.
|
|
||||||
*/
|
|
||||||
xmlEntityPtr
|
|
||||||
getParameterEntity(void *ctx, const xmlChar *name)
|
|
||||||
{
|
|
||||||
DEPRECATED("getParameterEntity")
|
|
||||||
return(xmlSAX2GetParameterEntity(ctx, name));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* entityDecl:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @name: the entity name
|
|
||||||
* @type: the entity type
|
|
||||||
* @publicId: The public ID of the entity
|
|
||||||
* @systemId: The system ID of the entity
|
|
||||||
* @content: the entity value (without processing).
|
|
||||||
*
|
|
||||||
* An entity definition has been parsed
|
|
||||||
* DEPRECATED: use xmlSAX2EntityDecl()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
entityDecl(void *ctx, const xmlChar *name, int type,
|
|
||||||
const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
|
|
||||||
{
|
|
||||||
DEPRECATED("entityDecl")
|
|
||||||
xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* attributeDecl:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @elem: the name of the element
|
|
||||||
* @fullname: the attribute name
|
|
||||||
* @type: the attribute type
|
|
||||||
* @def: the type of default value
|
|
||||||
* @defaultValue: the attribute default value
|
|
||||||
* @tree: the tree of enumerated value set
|
|
||||||
*
|
|
||||||
* An attribute definition has been parsed
|
|
||||||
* DEPRECATED: use xmlSAX2AttributeDecl()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
attributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname,
|
|
||||||
int type, int def, const xmlChar *defaultValue,
|
|
||||||
xmlEnumerationPtr tree)
|
|
||||||
{
|
|
||||||
DEPRECATED("attributeDecl")
|
|
||||||
xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue, tree);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* elementDecl:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @name: the element name
|
|
||||||
* @type: the element type
|
|
||||||
* @content: the element value tree
|
|
||||||
*
|
|
||||||
* An element definition has been parsed
|
|
||||||
* DEPRECATED: use xmlSAX2ElementDecl()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
elementDecl(void *ctx, const xmlChar * name, int type,
|
|
||||||
xmlElementContentPtr content)
|
|
||||||
{
|
|
||||||
DEPRECATED("elementDecl")
|
|
||||||
xmlSAX2ElementDecl(ctx, name, type, content);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* notationDecl:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @name: The name of the notation
|
|
||||||
* @publicId: The public ID of the entity
|
|
||||||
* @systemId: The system ID of the entity
|
|
||||||
*
|
|
||||||
* What to do when a notation declaration has been parsed.
|
|
||||||
* DEPRECATED: use xmlSAX2NotationDecl()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
notationDecl(void *ctx, const xmlChar *name,
|
|
||||||
const xmlChar *publicId, const xmlChar *systemId)
|
|
||||||
{
|
|
||||||
DEPRECATED("notationDecl")
|
|
||||||
xmlSAX2NotationDecl(ctx, name, publicId, systemId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* unparsedEntityDecl:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @name: The name of the entity
|
|
||||||
* @publicId: The public ID of the entity
|
|
||||||
* @systemId: The system ID of the entity
|
|
||||||
* @notationName: the name of the notation
|
|
||||||
*
|
|
||||||
* What to do when an unparsed entity declaration is parsed
|
|
||||||
* DEPRECATED: use xmlSAX2UnparsedEntityDecl()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
unparsedEntityDecl(void *ctx, const xmlChar *name,
|
|
||||||
const xmlChar *publicId, const xmlChar *systemId,
|
|
||||||
const xmlChar *notationName)
|
|
||||||
{
|
|
||||||
DEPRECATED("unparsedEntityDecl")
|
|
||||||
xmlSAX2UnparsedEntityDecl(ctx, name, publicId, systemId, notationName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* setDocumentLocator:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @loc: A SAX Locator
|
|
||||||
*
|
|
||||||
* Receive the document locator at startup, actually xmlDefaultSAXLocator
|
|
||||||
* Everything is available on the context, so this is useless in our case.
|
|
||||||
* DEPRECATED
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
setDocumentLocator(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
DEPRECATED("setDocumentLocator")
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* startDocument:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
*
|
|
||||||
* called when the document start being processed.
|
|
||||||
* DEPRECATED: use xmlSAX2StartDocument()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
startDocument(void *ctx)
|
|
||||||
{
|
|
||||||
DEPRECATED("startDocument")
|
|
||||||
xmlSAX2StartDocument(ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* endDocument:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
*
|
|
||||||
* called when the document end has been detected.
|
|
||||||
* DEPRECATED: use xmlSAX2EndDocument()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
endDocument(void *ctx)
|
|
||||||
{
|
|
||||||
DEPRECATED("endDocument")
|
|
||||||
xmlSAX2EndDocument(ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* attribute:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @fullname: The attribute name, including namespace prefix
|
|
||||||
* @value: The attribute value
|
|
||||||
*
|
|
||||||
* Handle an attribute that has been read by the parser.
|
|
||||||
* The default handling is to convert the attribute into an
|
|
||||||
* DOM subtree and past it in a new xmlAttr element added to
|
|
||||||
* the element.
|
|
||||||
* DEPRECATED: use xmlSAX2Attribute()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
attribute(void *ctx ATTRIBUTE_UNUSED, const xmlChar *fullname ATTRIBUTE_UNUSED, const xmlChar *value ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
DEPRECATED("attribute")
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* startElement:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @fullname: The element name, including namespace prefix
|
|
||||||
* @atts: An array of name/value attributes pairs, NULL terminated
|
|
||||||
*
|
|
||||||
* called when an opening tag has been processed.
|
|
||||||
* DEPRECATED: use xmlSAX2StartElement()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
startElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
|
|
||||||
{
|
|
||||||
DEPRECATED("startElement")
|
|
||||||
xmlSAX2StartElement(ctx, fullname, atts);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* endElement:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @name: The element name
|
|
||||||
*
|
|
||||||
* called when the end of an element has been detected.
|
|
||||||
* DEPRECATED: use xmlSAX2EndElement()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
endElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
DEPRECATED("endElement")
|
|
||||||
xmlSAX2EndElement(ctx, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* reference:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @name: The entity name
|
|
||||||
*
|
|
||||||
* called when an entity reference is detected.
|
|
||||||
* DEPRECATED: use xmlSAX2Reference()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
reference(void *ctx, const xmlChar *name)
|
|
||||||
{
|
|
||||||
DEPRECATED("reference")
|
|
||||||
xmlSAX2Reference(ctx, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* characters:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @ch: a xmlChar string
|
|
||||||
* @len: the number of xmlChar
|
|
||||||
*
|
|
||||||
* receiving some chars from the parser.
|
|
||||||
* DEPRECATED: use xmlSAX2Characters()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
characters(void *ctx, const xmlChar *ch, int len)
|
|
||||||
{
|
|
||||||
DEPRECATED("characters")
|
|
||||||
xmlSAX2Characters(ctx, ch, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ignorableWhitespace:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @ch: a xmlChar string
|
|
||||||
* @len: the number of xmlChar
|
|
||||||
*
|
|
||||||
* receiving some ignorable whitespaces from the parser.
|
|
||||||
* UNUSED: by default the DOM building will use characters
|
|
||||||
* DEPRECATED: use xmlSAX2IgnorableWhitespace()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
ignorableWhitespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch ATTRIBUTE_UNUSED, int len ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
DEPRECATED("ignorableWhitespace")
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* processingInstruction:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @target: the target name
|
|
||||||
* @data: the PI data's
|
|
||||||
*
|
|
||||||
* A processing instruction has been parsed.
|
|
||||||
* DEPRECATED: use xmlSAX2ProcessingInstruction()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
processingInstruction(void *ctx, const xmlChar *target,
|
|
||||||
const xmlChar *data)
|
|
||||||
{
|
|
||||||
DEPRECATED("processingInstruction")
|
|
||||||
xmlSAX2ProcessingInstruction(ctx, target, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* globalNamespace:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @href: the namespace associated URN
|
|
||||||
* @prefix: the namespace prefix
|
|
||||||
*
|
|
||||||
* An old global namespace has been parsed.
|
|
||||||
* DEPRECATED
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
globalNamespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *href ATTRIBUTE_UNUSED, const xmlChar *prefix ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
DEPRECATED("globalNamespace")
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* setNamespace:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @name: the namespace prefix
|
|
||||||
*
|
|
||||||
* Set the current element namespace.
|
|
||||||
* DEPRECATED
|
|
||||||
*/
|
|
||||||
|
|
||||||
void
|
|
||||||
setNamespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
DEPRECATED("setNamespace")
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* getNamespace:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
*
|
|
||||||
* Get the current element namespace.
|
|
||||||
* DEPRECATED
|
|
||||||
*
|
|
||||||
* Returns the xmlNsPtr or NULL if none
|
|
||||||
*/
|
|
||||||
|
|
||||||
xmlNsPtr
|
|
||||||
getNamespace(void *ctx ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
DEPRECATED("getNamespace")
|
|
||||||
return(NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* checkNamespace:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @namespace: the namespace to check against
|
|
||||||
*
|
|
||||||
* Check that the current element namespace is the same as the
|
|
||||||
* one read upon parsing.
|
|
||||||
* DEPRECATED
|
|
||||||
*
|
|
||||||
* Returns 1 if true 0 otherwise
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
checkNamespace(void *ctx ATTRIBUTE_UNUSED, xmlChar *namespace ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
DEPRECATED("checkNamespace")
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* namespaceDecl:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @href: the namespace associated URN
|
|
||||||
* @prefix: the namespace prefix
|
|
||||||
*
|
|
||||||
* A namespace has been parsed.
|
|
||||||
* DEPRECATED
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
namespaceDecl(void *ctx ATTRIBUTE_UNUSED, const xmlChar *href ATTRIBUTE_UNUSED, const xmlChar *prefix ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
DEPRECATED("namespaceDecl")
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* comment:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @value: the comment content
|
|
||||||
*
|
|
||||||
* A comment has been parsed.
|
|
||||||
* DEPRECATED: use xmlSAX2Comment()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
comment(void *ctx, const xmlChar *value)
|
|
||||||
{
|
|
||||||
DEPRECATED("comment")
|
|
||||||
xmlSAX2Comment(ctx, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* cdataBlock:
|
|
||||||
* @ctx: the user data (XML parser context)
|
|
||||||
* @value: The pcdata content
|
|
||||||
* @len: the block length
|
|
||||||
*
|
|
||||||
* called when a pcdata block has been parsed
|
|
||||||
* DEPRECATED: use xmlSAX2CDataBlock()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
cdataBlock(void *ctx, const xmlChar *value, int len)
|
|
||||||
{
|
|
||||||
DEPRECATED("cdataBlock")
|
|
||||||
xmlSAX2CDataBlock(ctx, value, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initxmlDefaultSAXHandler:
|
* initxmlDefaultSAXHandler:
|
||||||
* @hdlr: the SAX handler
|
* @hdlr: the SAX handler
|
||||||
|
38
SAX2.c
38
SAX2.c
@ -560,12 +560,14 @@ xmlSAX2AttributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname,
|
|||||||
xmlFreeEnumeration(tree);
|
xmlFreeEnumeration(tree);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if (ctxt->vctxt.valid == 0)
|
if (ctxt->vctxt.valid == 0)
|
||||||
ctxt->valid = 0;
|
ctxt->valid = 0;
|
||||||
if ((attr != NULL) && (ctxt->validate) && (ctxt->wellFormed) &&
|
if ((attr != NULL) && (ctxt->validate) && (ctxt->wellFormed) &&
|
||||||
(ctxt->myDoc != NULL) && (ctxt->myDoc->intSubset != NULL))
|
(ctxt->myDoc != NULL) && (ctxt->myDoc->intSubset != NULL))
|
||||||
ctxt->valid &= xmlValidateAttributeDecl(&ctxt->vctxt, ctxt->myDoc,
|
ctxt->valid &= xmlValidateAttributeDecl(&ctxt->vctxt, ctxt->myDoc,
|
||||||
attr);
|
attr);
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
if (prefix != NULL)
|
if (prefix != NULL)
|
||||||
xmlFree(prefix);
|
xmlFree(prefix);
|
||||||
if (name != NULL)
|
if (name != NULL)
|
||||||
@ -606,12 +608,14 @@ xmlSAX2ElementDecl(void *ctx, const xmlChar * name, int type,
|
|||||||
name);
|
name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if (elem == NULL)
|
if (elem == NULL)
|
||||||
ctxt->valid = 0;
|
ctxt->valid = 0;
|
||||||
if (ctxt->validate && ctxt->wellFormed &&
|
if (ctxt->validate && ctxt->wellFormed &&
|
||||||
ctxt->myDoc && ctxt->myDoc->intSubset)
|
ctxt->myDoc && ctxt->myDoc->intSubset)
|
||||||
ctxt->valid &=
|
ctxt->valid &=
|
||||||
xmlValidateElementDecl(&ctxt->vctxt, ctxt->myDoc, elem);
|
xmlValidateElementDecl(&ctxt->vctxt, ctxt->myDoc, elem);
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -654,11 +658,13 @@ xmlSAX2NotationDecl(void *ctx, const xmlChar *name,
|
|||||||
"SAX.xmlSAX2NotationDecl(%s) called while not in subset\n", name);
|
"SAX.xmlSAX2NotationDecl(%s) called while not in subset\n", name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if (nota == NULL) ctxt->valid = 0;
|
if (nota == NULL) ctxt->valid = 0;
|
||||||
if (ctxt->validate && ctxt->wellFormed &&
|
if (ctxt->validate && ctxt->wellFormed &&
|
||||||
ctxt->myDoc && ctxt->myDoc->intSubset)
|
ctxt->myDoc && ctxt->myDoc->intSubset)
|
||||||
ctxt->valid &= xmlValidateNotationDecl(&ctxt->vctxt, ctxt->myDoc,
|
ctxt->valid &= xmlValidateNotationDecl(&ctxt->vctxt, ctxt->myDoc,
|
||||||
nota);
|
nota);
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -827,9 +833,11 @@ xmlSAX2EndDocument(void *ctx)
|
|||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"SAX.xmlSAX2EndDocument()\n");
|
"SAX.xmlSAX2EndDocument()\n");
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if (ctxt->validate && ctxt->wellFormed &&
|
if (ctxt->validate && ctxt->wellFormed &&
|
||||||
ctxt->myDoc && ctxt->myDoc->intSubset)
|
ctxt->myDoc && ctxt->myDoc->intSubset)
|
||||||
ctxt->valid &= xmlValidateDocumentFinal(&ctxt->vctxt, ctxt->myDoc);
|
ctxt->valid &= xmlValidateDocumentFinal(&ctxt->vctxt, ctxt->myDoc);
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Grab the encoding if it was added on-the-fly
|
* Grab the encoding if it was added on-the-fly
|
||||||
@ -904,6 +912,7 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/*
|
/*
|
||||||
* Do the last stage of the attribute normalization
|
* Do the last stage of the attribute normalization
|
||||||
* Needed for HTML too:
|
* Needed for HTML too:
|
||||||
@ -918,6 +927,9 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
|
|||||||
}
|
}
|
||||||
if (nval != NULL)
|
if (nval != NULL)
|
||||||
value = nval;
|
value = nval;
|
||||||
|
#else
|
||||||
|
nval = NULL;
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check whether it's a namespace definition
|
* Check whether it's a namespace definition
|
||||||
@ -958,6 +970,7 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
|
|||||||
/* a default namespace definition */
|
/* a default namespace definition */
|
||||||
nsret = xmlNewNs(ctxt->node, val, NULL);
|
nsret = xmlNewNs(ctxt->node, val, NULL);
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/*
|
/*
|
||||||
* Validate also for namespace decls, they are attributes from
|
* Validate also for namespace decls, they are attributes from
|
||||||
* an XML-1.0 perspective
|
* an XML-1.0 perspective
|
||||||
@ -966,6 +979,7 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
|
|||||||
ctxt->myDoc && ctxt->myDoc->intSubset)
|
ctxt->myDoc && ctxt->myDoc->intSubset)
|
||||||
ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
|
ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
|
||||||
ctxt->node, prefix, nsret, val);
|
ctxt->node, prefix, nsret, val);
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
if (name != NULL)
|
if (name != NULL)
|
||||||
xmlFree(name);
|
xmlFree(name);
|
||||||
if (nval != NULL)
|
if (nval != NULL)
|
||||||
@ -1027,6 +1041,7 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
|
|||||||
/* a standard namespace definition */
|
/* a standard namespace definition */
|
||||||
nsret = xmlNewNs(ctxt->node, val, name);
|
nsret = xmlNewNs(ctxt->node, val, name);
|
||||||
xmlFree(ns);
|
xmlFree(ns);
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/*
|
/*
|
||||||
* Validate also for namespace decls, they are attributes from
|
* Validate also for namespace decls, they are attributes from
|
||||||
* an XML-1.0 perspective
|
* an XML-1.0 perspective
|
||||||
@ -1035,6 +1050,7 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
|
|||||||
ctxt->myDoc && ctxt->myDoc->intSubset)
|
ctxt->myDoc && ctxt->myDoc->intSubset)
|
||||||
ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
|
ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
|
||||||
ctxt->node, prefix, nsret, value);
|
ctxt->node, prefix, nsret, value);
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
if (name != NULL)
|
if (name != NULL)
|
||||||
xmlFree(name);
|
xmlFree(name);
|
||||||
if (nval != NULL)
|
if (nval != NULL)
|
||||||
@ -1099,6 +1115,7 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
|
if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
|
||||||
ctxt->myDoc && ctxt->myDoc->intSubset) {
|
ctxt->myDoc && ctxt->myDoc->intSubset) {
|
||||||
|
|
||||||
@ -1140,7 +1157,9 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
|
|||||||
ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt, ctxt->myDoc,
|
ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt, ctxt->myDoc,
|
||||||
ctxt->node, ret, value);
|
ctxt->node, ret, value);
|
||||||
}
|
}
|
||||||
} else if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
|
} else
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
|
||||||
(((ctxt->replaceEntities == 0) && (ctxt->external != 2)) ||
|
(((ctxt->replaceEntities == 0) && (ctxt->external != 2)) ||
|
||||||
((ctxt->replaceEntities != 0) && (ctxt->inSubset == 0)))) {
|
((ctxt->replaceEntities != 0) && (ctxt->inSubset == 0)))) {
|
||||||
/*
|
/*
|
||||||
@ -1500,6 +1519,7 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/*
|
/*
|
||||||
* If it's the Document root, finish the DTD validation and
|
* If it's the Document root, finish the DTD validation and
|
||||||
* check the document root element for validity
|
* check the document root element for validity
|
||||||
@ -1515,6 +1535,7 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
|
|||||||
ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
|
ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
|
||||||
ctxt->vctxt.finishDtd = 1;
|
ctxt->vctxt.finishDtd = 1;
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
if (prefix != NULL)
|
if (prefix != NULL)
|
||||||
xmlFree(prefix);
|
xmlFree(prefix);
|
||||||
@ -1551,10 +1572,12 @@ xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
ctxt->nodemem = -1;
|
ctxt->nodemem = -1;
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if (ctxt->validate && ctxt->wellFormed &&
|
if (ctxt->validate && ctxt->wellFormed &&
|
||||||
ctxt->myDoc && ctxt->myDoc->intSubset)
|
ctxt->myDoc && ctxt->myDoc->intSubset)
|
||||||
ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
|
ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
|
||||||
cur);
|
cur);
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1636,6 +1659,7 @@ skip:
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/*
|
/*
|
||||||
* xmlSAX2DecodeAttrEntities:
|
* xmlSAX2DecodeAttrEntities:
|
||||||
* @ctxt: the parser context
|
* @ctxt: the parser context
|
||||||
@ -1664,6 +1688,7 @@ decode:
|
|||||||
ctxt->depth--;
|
ctxt->depth--;
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlSAX2AttributeNs:
|
* xmlSAX2AttributeNs:
|
||||||
@ -1781,6 +1806,7 @@ xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
|
if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
|
||||||
ctxt->myDoc && ctxt->myDoc->intSubset) {
|
ctxt->myDoc && ctxt->myDoc->intSubset) {
|
||||||
/*
|
/*
|
||||||
@ -1848,7 +1874,9 @@ xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt,
|
|||||||
ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
|
ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
|
||||||
ctxt->myDoc, ctxt->node, ret, dup);
|
ctxt->myDoc, ctxt->node, ret, dup);
|
||||||
}
|
}
|
||||||
} else if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
|
} else
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
|
||||||
(((ctxt->replaceEntities == 0) && (ctxt->external != 2)) ||
|
(((ctxt->replaceEntities == 0) && (ctxt->external != 2)) ||
|
||||||
((ctxt->replaceEntities != 0) && (ctxt->inSubset == 0)))) {
|
((ctxt->replaceEntities != 0) && (ctxt->inSubset == 0)))) {
|
||||||
/*
|
/*
|
||||||
@ -1985,11 +2013,13 @@ xmlSAX2StartElementNs(void *ctx,
|
|||||||
ctxt->disableSAX = 1;
|
ctxt->disableSAX = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
|
if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
|
||||||
ctxt->myDoc && ctxt->myDoc->intSubset) {
|
ctxt->myDoc && ctxt->myDoc->intSubset) {
|
||||||
ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
|
ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
|
||||||
ret, prefix, ns, uri);
|
ret, prefix, ns, uri);
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
}
|
}
|
||||||
ctxt->nodemem = -1;
|
ctxt->nodemem = -1;
|
||||||
|
|
||||||
@ -2039,6 +2069,7 @@ xmlSAX2StartElementNs(void *ctx,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/*
|
/*
|
||||||
* If it's the Document root, finish the DTD validation and
|
* If it's the Document root, finish the DTD validation and
|
||||||
* check the document root element for validity
|
* check the document root element for validity
|
||||||
@ -2054,6 +2085,7 @@ xmlSAX2StartElementNs(void *ctx,
|
|||||||
ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
|
ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
|
||||||
ctxt->vctxt.finishDtd = 1;
|
ctxt->vctxt.finishDtd = 1;
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2085,9 +2117,11 @@ xmlSAX2EndElementNs(void *ctx,
|
|||||||
}
|
}
|
||||||
ctxt->nodemem = -1;
|
ctxt->nodemem = -1;
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if (ctxt->validate && ctxt->wellFormed &&
|
if (ctxt->validate && ctxt->wellFormed &&
|
||||||
ctxt->myDoc && ctxt->myDoc->intSubset)
|
ctxt->myDoc && ctxt->myDoc->intSubset)
|
||||||
ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc, cur);
|
ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc, cur);
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* end of parsing of this node.
|
* end of parsing of this node.
|
||||||
|
159
configure.in
159
configure.in
@ -43,6 +43,15 @@ AM_PROG_LIBTOOL
|
|||||||
|
|
||||||
AM_MAINTAINER_MODE
|
AM_MAINTAINER_MODE
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl option to build a minimal libxml2 library
|
||||||
|
dnl
|
||||||
|
AC_ARG_WITH(minimum, [ --with-minimum build a minimally sized library (off)])
|
||||||
|
if test "$with_minimum" = "yes"
|
||||||
|
then
|
||||||
|
echo "Configuring for a minimal library"
|
||||||
|
fi
|
||||||
|
|
||||||
dnl Checks for zlib library.
|
dnl Checks for zlib library.
|
||||||
_cppflags="${CPPFLAGS}"
|
_cppflags="${CPPFLAGS}"
|
||||||
_ldflags="${LDFLAGS}"
|
_ldflags="${LDFLAGS}"
|
||||||
@ -56,6 +65,10 @@ AC_ARG_WITH(zlib,
|
|||||||
LDFLAGS="${LDFLAGS} -L$withval/lib"
|
LDFLAGS="${LDFLAGS} -L$withval/lib"
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_zlib" = ""
|
||||||
|
then
|
||||||
|
with_zlib=no
|
||||||
|
fi
|
||||||
if test "$with_zlib" = "no"; then
|
if test "$with_zlib" = "no"; then
|
||||||
echo "Disabling compression support"
|
echo "Disabling compression support"
|
||||||
else
|
else
|
||||||
@ -197,6 +210,10 @@ dnl ***********************Checking for availability of IPv6*******************
|
|||||||
|
|
||||||
AC_MSG_CHECKING([whether to enable IPv6])
|
AC_MSG_CHECKING([whether to enable IPv6])
|
||||||
AC_ARG_ENABLE(ipv6, [ --enable-ipv6=[yes/no] enables compilation of IPv6 code],, enable_ipv6=yes)
|
AC_ARG_ENABLE(ipv6, [ --enable-ipv6=[yes/no] enables compilation of IPv6 code],, enable_ipv6=yes)
|
||||||
|
if test "$with_minimum" = "yes"
|
||||||
|
then
|
||||||
|
enable_ipv6=no
|
||||||
|
fi
|
||||||
if test $enable_ipv6 = yes; then
|
if test $enable_ipv6 = yes; then
|
||||||
have_ipv6=no
|
have_ipv6=no
|
||||||
AC_TRY_COMPILE([
|
AC_TRY_COMPILE([
|
||||||
@ -247,6 +264,10 @@ RDL_LIBS=""
|
|||||||
|
|
||||||
AC_ARG_WITH(fexceptions,
|
AC_ARG_WITH(fexceptions,
|
||||||
[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
|
[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_fexceptions" = ""
|
||||||
|
then
|
||||||
|
with_fexceptions=no
|
||||||
|
fi
|
||||||
dnl
|
dnl
|
||||||
dnl Workaround for native compilers
|
dnl Workaround for native compilers
|
||||||
dnl HP : http://bugs.gnome.org/db/31/3163.html
|
dnl HP : http://bugs.gnome.org/db/31/3163.html
|
||||||
@ -305,6 +326,10 @@ PYTHON_SITE_PACKAGES=
|
|||||||
pythondir=
|
pythondir=
|
||||||
AC_ARG_WITH(python,
|
AC_ARG_WITH(python,
|
||||||
[ --with-python[[=DIR]] build Python bindings if found])
|
[ --with-python[[=DIR]] build Python bindings if found])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_python" = ""
|
||||||
|
then
|
||||||
|
with_python=no
|
||||||
|
fi
|
||||||
if test "$with_python" != "no" ; then
|
if test "$with_python" != "no" ; then
|
||||||
if test -x "$with_python/bin/python"
|
if test -x "$with_python/bin/python"
|
||||||
then
|
then
|
||||||
@ -382,18 +407,25 @@ AC_ARG_WITH(readline,
|
|||||||
LDFLAGS="${LDFLAGS} -L$withval/lib"
|
LDFLAGS="${LDFLAGS} -L$withval/lib"
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_readline" = ""
|
||||||
|
then
|
||||||
|
with_readline=no
|
||||||
|
fi
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl specific tests to setup DV's devel environment with debug etc ...
|
dnl specific tests to setup DV's devel environment with debug etc ...
|
||||||
dnl (-Wunreachable-code)
|
dnl (-Wunreachable-code)
|
||||||
dnl
|
dnl
|
||||||
if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ; then
|
if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ; then
|
||||||
|
if test "$with_minimum" != "yes"
|
||||||
|
then
|
||||||
if test "${with_mem_debug}" = "" ; then
|
if test "${with_mem_debug}" = "" ; then
|
||||||
with_mem_debug="yes"
|
with_mem_debug="yes"
|
||||||
fi
|
fi
|
||||||
if test "${with_docbook}" = "" ; then
|
if test "${with_docbook}" = "" ; then
|
||||||
with_docbook="yes"
|
with_docbook="yes"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
CFLAGS="-g -O -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls "
|
CFLAGS="-g -O -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls "
|
||||||
STATIC_BINARIES="-static"
|
STATIC_BINARIES="-static"
|
||||||
dnl -Wcast-qual -ansi
|
dnl -Wcast-qual -ansi
|
||||||
@ -426,6 +458,10 @@ TEST_THREADS=""
|
|||||||
|
|
||||||
AC_ARG_WITH(threads,
|
AC_ARG_WITH(threads,
|
||||||
[ --with-threads add multithread support(on)])
|
[ --with-threads add multithread support(on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_threads" = ""
|
||||||
|
then
|
||||||
|
with_threads=no
|
||||||
|
fi
|
||||||
if test "$with_threads" = "no" ; then
|
if test "$with_threads" = "no" ; then
|
||||||
echo Disabling multithreaded support
|
echo Disabling multithreaded support
|
||||||
else
|
else
|
||||||
@ -445,6 +481,10 @@ else
|
|||||||
fi
|
fi
|
||||||
AC_ARG_WITH(thread-alloc,
|
AC_ARG_WITH(thread-alloc,
|
||||||
[ --with-thread-alloc add per-thread memory(off)])
|
[ --with-thread-alloc add per-thread memory(off)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_thread_alloc" = ""
|
||||||
|
then
|
||||||
|
with_thread_alloc=no
|
||||||
|
fi
|
||||||
if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
|
if test "$with_threads_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
|
||||||
THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
|
THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
|
||||||
fi
|
fi
|
||||||
@ -456,6 +496,10 @@ AC_SUBST(TEST_THREADS)
|
|||||||
|
|
||||||
AC_ARG_WITH(history,
|
AC_ARG_WITH(history,
|
||||||
[ --with-history add history support to xmllint shell(off)])
|
[ --with-history add history support to xmllint shell(off)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_history" = ""
|
||||||
|
then
|
||||||
|
with_history=no
|
||||||
|
fi
|
||||||
if test "$with_history" = "yes" ; then
|
if test "$with_history" = "yes" ; then
|
||||||
echo Enabling xmllint shell history
|
echo Enabling xmllint shell history
|
||||||
dnl check for terminal library. this is a very cool solution
|
dnl check for terminal library. this is a very cool solution
|
||||||
@ -487,6 +531,10 @@ AC_SUBST(WITH_FTP)
|
|||||||
AC_SUBST(FTP_OBJ)
|
AC_SUBST(FTP_OBJ)
|
||||||
AC_ARG_WITH(ftp,
|
AC_ARG_WITH(ftp,
|
||||||
[ --with-ftp add the FTP support (on)])
|
[ --with-ftp add the FTP support (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_ftp" = ""
|
||||||
|
then
|
||||||
|
with_ftp=no
|
||||||
|
fi
|
||||||
if test "$with_ftp" = "no" ; then
|
if test "$with_ftp" = "no" ; then
|
||||||
echo Disabling FTP support
|
echo Disabling FTP support
|
||||||
WITH_FTP=0
|
WITH_FTP=0
|
||||||
@ -500,6 +548,10 @@ AC_SUBST(FTP_OBJ)
|
|||||||
|
|
||||||
AC_ARG_WITH(http,
|
AC_ARG_WITH(http,
|
||||||
[ --with-http add the HTTP support (on)])
|
[ --with-http add the HTTP support (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_http" = ""
|
||||||
|
then
|
||||||
|
with_http=no
|
||||||
|
fi
|
||||||
if test "$with_http" = "no" ; then
|
if test "$with_http" = "no" ; then
|
||||||
echo Disabling HTTP support
|
echo Disabling HTTP support
|
||||||
WITH_HTTP=0
|
WITH_HTTP=0
|
||||||
@ -513,32 +565,84 @@ AC_SUBST(HTTP_OBJ)
|
|||||||
|
|
||||||
AC_ARG_WITH(html,
|
AC_ARG_WITH(html,
|
||||||
[ --with-html add the HTML support (on)])
|
[ --with-html add the HTML support (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_html" = ""
|
||||||
|
then
|
||||||
|
with_html=no
|
||||||
|
fi
|
||||||
if test "$with_html" = "no" ; then
|
if test "$with_html" = "no" ; then
|
||||||
echo Disabling HTML support
|
echo Disabling HTML support
|
||||||
WITH_HTML=0
|
WITH_HTML=0
|
||||||
HTML_OBJ=
|
HTML_OBJ=
|
||||||
|
TEST_HTML=
|
||||||
else
|
else
|
||||||
WITH_HTML=1
|
WITH_HTML=1
|
||||||
HTML_OBJ="HTMLparser.o HTMLtree.o"
|
HTML_OBJ="HTMLparser.o HTMLtree.o"
|
||||||
|
TEST_HTML=HTMLtests
|
||||||
fi
|
fi
|
||||||
AC_SUBST(WITH_HTML)
|
AC_SUBST(WITH_HTML)
|
||||||
AC_SUBST(HTML_OBJ)
|
AC_SUBST(HTML_OBJ)
|
||||||
|
AC_SUBST(TEST_HTML)
|
||||||
|
|
||||||
|
AC_ARG_WITH(legacy,
|
||||||
|
[ --with-legacy add deprecated APIs for compatibility (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_legacy" = ""
|
||||||
|
then
|
||||||
|
with_legacy=no
|
||||||
|
fi
|
||||||
|
if test "$with_legacy" = "no" ; then
|
||||||
|
echo Disabling deprecated APIs
|
||||||
|
WITH_LEGACY=0
|
||||||
|
else
|
||||||
|
WITH_LEGACY=1
|
||||||
|
fi
|
||||||
|
AC_SUBST(WITH_LEGACY)
|
||||||
|
|
||||||
|
AC_ARG_WITH(valid,
|
||||||
|
[ --with-valid add the DTD validation support (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_valid" = ""
|
||||||
|
then
|
||||||
|
with_valid=no
|
||||||
|
fi
|
||||||
|
if test "$with_html" = "no" ; then
|
||||||
|
echo Disabling DTD validation support
|
||||||
|
WITH_VALID=0
|
||||||
|
TEST_VALID=
|
||||||
|
TEST_VTIME=
|
||||||
|
else
|
||||||
|
WITH_VALID=1
|
||||||
|
TEST_VALID=Validtests
|
||||||
|
TEST_VTIME=VTimingtests
|
||||||
|
fi
|
||||||
|
AC_SUBST(WITH_VALID)
|
||||||
|
AC_SUBST(TEST_VALID)
|
||||||
|
AC_SUBST(TEST_VTIME)
|
||||||
|
|
||||||
AC_ARG_WITH(catalog,
|
AC_ARG_WITH(catalog,
|
||||||
[ --with-catalog add the Catalog support (on)])
|
[ --with-catalog add the Catalog support (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_catalog" = ""
|
||||||
|
then
|
||||||
|
with_catalog=no
|
||||||
|
fi
|
||||||
if test "$with_catalog" = "no" ; then
|
if test "$with_catalog" = "no" ; then
|
||||||
echo Disabling Catalog support
|
echo Disabling Catalog support
|
||||||
WITH_CATALOG=0
|
WITH_CATALOG=0
|
||||||
CATALOG_OBJ=
|
CATALOG_OBJ=
|
||||||
|
TEST_CATALOG=
|
||||||
else
|
else
|
||||||
WITH_CATALOG=1
|
WITH_CATALOG=1
|
||||||
CATALOG_OBJ="catalog.o"
|
CATALOG_OBJ="catalog.o"
|
||||||
|
TEST_CATALOG=Catatests
|
||||||
fi
|
fi
|
||||||
AC_SUBST(WITH_CATALOG)
|
AC_SUBST(WITH_CATALOG)
|
||||||
AC_SUBST(CATALOG_OBJ)
|
AC_SUBST(CATALOG_OBJ)
|
||||||
|
AC_SUBST(TEST_CATALOG)
|
||||||
|
|
||||||
AC_ARG_WITH(docbook,
|
AC_ARG_WITH(docbook,
|
||||||
[ --with-docbook add Docbook SGML support (on)])
|
[ --with-docbook add Docbook SGML support (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_docbook" = ""
|
||||||
|
then
|
||||||
|
with_docbook=no
|
||||||
|
fi
|
||||||
if test "$with_docbook" = "no" ; then
|
if test "$with_docbook" = "no" ; then
|
||||||
echo Disabling Docbook support
|
echo Disabling Docbook support
|
||||||
WITH_DOCB=0
|
WITH_DOCB=0
|
||||||
@ -553,6 +657,10 @@ AC_SUBST(DOCB_OBJ)
|
|||||||
|
|
||||||
AC_ARG_WITH(xpath,
|
AC_ARG_WITH(xpath,
|
||||||
[ --with-xpath add the XPATH support (on)])
|
[ --with-xpath add the XPATH support (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_xpath" = ""
|
||||||
|
then
|
||||||
|
with_xpath=no
|
||||||
|
fi
|
||||||
if test "$with_xpath" = "no" ; then
|
if test "$with_xpath" = "no" ; then
|
||||||
echo Disabling XPATH support
|
echo Disabling XPATH support
|
||||||
with_xptr="no"
|
with_xptr="no"
|
||||||
@ -560,56 +668,84 @@ if test "$with_xpath" = "no" ; then
|
|||||||
with_xinclude="no"
|
with_xinclude="no"
|
||||||
WITH_XPATH=0
|
WITH_XPATH=0
|
||||||
XPATH_OBJ=
|
XPATH_OBJ=
|
||||||
|
TEST_XPATH=
|
||||||
else
|
else
|
||||||
WITH_XPATH=1
|
WITH_XPATH=1
|
||||||
XPATH_OBJ=xpath.o
|
XPATH_OBJ=xpath.o
|
||||||
|
TEST_XPATH=XPathtests
|
||||||
fi
|
fi
|
||||||
AC_SUBST(WITH_XPATH)
|
AC_SUBST(WITH_XPATH)
|
||||||
AC_SUBST(XPATH_OBJ)
|
AC_SUBST(XPATH_OBJ)
|
||||||
|
AC_SUBST(TEST_XPATH)
|
||||||
|
|
||||||
AC_ARG_WITH(xptr,
|
AC_ARG_WITH(xptr,
|
||||||
[ --with-xptr add the XPointer support (on)])
|
[ --with-xptr add the XPointer support (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_xptr" = ""
|
||||||
|
then
|
||||||
|
with_xptr=no
|
||||||
|
fi
|
||||||
if test "$with_xptr" = "no" ; then
|
if test "$with_xptr" = "no" ; then
|
||||||
echo Disabling XPointer support
|
echo Disabling XPointer support
|
||||||
WITH_XPTR=0
|
WITH_XPTR=0
|
||||||
XPTR_OBJ=
|
XPTR_OBJ=
|
||||||
|
TEST_XPTR=
|
||||||
else
|
else
|
||||||
WITH_XPTR=1
|
WITH_XPTR=1
|
||||||
XPTR_OBJ=xpointer.o
|
XPTR_OBJ=xpointer.o
|
||||||
|
TEST_XPTR=XPtrtests
|
||||||
fi
|
fi
|
||||||
AC_SUBST(WITH_XPTR)
|
AC_SUBST(WITH_XPTR)
|
||||||
AC_SUBST(XPTR_OBJ)
|
AC_SUBST(XPTR_OBJ)
|
||||||
|
AC_SUBST(TEST_XPTR)
|
||||||
|
|
||||||
AC_ARG_WITH(c14n,
|
AC_ARG_WITH(c14n,
|
||||||
[ --with-c14n add the Canonicalization support (on)])
|
[ --with-c14n add the Canonicalization support (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_c14n" = ""
|
||||||
|
then
|
||||||
|
with_c14n=no
|
||||||
|
fi
|
||||||
if test "$with_c14n" = "no" ; then
|
if test "$with_c14n" = "no" ; then
|
||||||
echo Disabling C14N support
|
echo Disabling C14N support
|
||||||
WITH_C14N=0
|
WITH_C14N=0
|
||||||
C14N_OBJ=
|
C14N_OBJ=
|
||||||
|
TEST_C14N=
|
||||||
else
|
else
|
||||||
WITH_C14N=1
|
WITH_C14N=1
|
||||||
C14N_OBJ="c14n.c"
|
C14N_OBJ="c14n.c"
|
||||||
|
TEST_C14N=C14Ntests
|
||||||
fi
|
fi
|
||||||
AC_SUBST(WITH_C14N)
|
AC_SUBST(WITH_C14N)
|
||||||
AC_SUBST(C14N_OBJ)
|
AC_SUBST(C14N_OBJ)
|
||||||
|
AC_SUBST(TEST_C14N)
|
||||||
|
|
||||||
AC_ARG_WITH(xinclude,
|
AC_ARG_WITH(xinclude,
|
||||||
[ --with-xinclude add the XInclude support (on)])
|
[ --with-xinclude add the XInclude support (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_xinclude" = ""
|
||||||
|
then
|
||||||
|
with_xinclude=no
|
||||||
|
fi
|
||||||
if test "$with_xinclude" = "no" ; then
|
if test "$with_xinclude" = "no" ; then
|
||||||
echo Disabling XInclude support
|
echo Disabling XInclude support
|
||||||
WITH_XINCLUDE=0
|
WITH_XINCLUDE=0
|
||||||
XINCLUDE_OBJ=
|
XINCLUDE_OBJ=
|
||||||
with_xinclude="no"
|
with_xinclude="no"
|
||||||
|
TEST_XINCLUDE=
|
||||||
else
|
else
|
||||||
WITH_XINCLUDE=1
|
WITH_XINCLUDE=1
|
||||||
XINCLUDE_OBJ=xinclude.o
|
XINCLUDE_OBJ=xinclude.o
|
||||||
|
TEST_XINCLUDE=XIncludetests
|
||||||
fi
|
fi
|
||||||
AC_SUBST(WITH_XINCLUDE)
|
AC_SUBST(WITH_XINCLUDE)
|
||||||
AC_SUBST(XINCLUDE_OBJ)
|
AC_SUBST(XINCLUDE_OBJ)
|
||||||
|
AC_SUBST(TEST_XINCLUDE)
|
||||||
|
|
||||||
WITH_ICONV=0
|
WITH_ICONV=0
|
||||||
AC_ARG_WITH(iconv,
|
AC_ARG_WITH(iconv,
|
||||||
[ --with-iconv[[=DIR]] add ICONV support (on)])
|
[ --with-iconv[[=DIR]] add ICONV support (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_iconv" = ""
|
||||||
|
then
|
||||||
|
with_iconv=no
|
||||||
|
fi
|
||||||
if test "$with_iconv" = "no" ; then
|
if test "$with_iconv" = "no" ; then
|
||||||
echo Disabling ICONV support
|
echo Disabling ICONV support
|
||||||
else
|
else
|
||||||
@ -657,6 +793,10 @@ AC_SUBST(WITH_ICONV)
|
|||||||
WITH_ISO8859X=1
|
WITH_ISO8859X=1
|
||||||
AC_ARG_WITH(iso8859x,
|
AC_ARG_WITH(iso8859x,
|
||||||
[ --with-iso8859x add ISO8859X support if no iconv (on)])
|
[ --with-iso8859x add ISO8859X support if no iconv (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_iso8859x" = ""
|
||||||
|
then
|
||||||
|
with_iso8859x=no
|
||||||
|
fi
|
||||||
if test "$WITH_ICONV" != "1" ; then
|
if test "$WITH_ICONV" != "1" ; then
|
||||||
if test "$with_iso8859x" = "no" ; then
|
if test "$with_iso8859x" = "no" ; then
|
||||||
echo Disabling ISO8859X support
|
echo Disabling ISO8859X support
|
||||||
@ -667,6 +807,10 @@ AC_SUBST(WITH_ISO8859X)
|
|||||||
|
|
||||||
AC_ARG_WITH(schemas,
|
AC_ARG_WITH(schemas,
|
||||||
[ --with-schemas add experimental Schemas/RelaxNG support (on)])
|
[ --with-schemas add experimental Schemas/RelaxNG support (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_schemas" = ""
|
||||||
|
then
|
||||||
|
with_schemas=no
|
||||||
|
fi
|
||||||
if test "$with_schemas" = "no" ; then
|
if test "$with_schemas" = "no" ; then
|
||||||
echo "Disabled Schemas/Relax-NG support"
|
echo "Disabled Schemas/Relax-NG support"
|
||||||
WITH_SCHEMAS=0
|
WITH_SCHEMAS=0
|
||||||
@ -682,6 +826,10 @@ AC_SUBST(TEST_SCHEMAS)
|
|||||||
|
|
||||||
AC_ARG_WITH(regexps,
|
AC_ARG_WITH(regexps,
|
||||||
[ --with-regexps add Regular Expressions support (on)])
|
[ --with-regexps add Regular Expressions support (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_regexps" = ""
|
||||||
|
then
|
||||||
|
with_regexps=no
|
||||||
|
fi
|
||||||
if test "$with_regexps" = "no" ; then
|
if test "$with_regexps" = "no" ; then
|
||||||
echo Disabling Regexps support
|
echo Disabling Regexps support
|
||||||
WITH_REGEXPS=0
|
WITH_REGEXPS=0
|
||||||
@ -695,19 +843,30 @@ AC_SUBST(TEST_REGEXPS)
|
|||||||
|
|
||||||
AC_ARG_WITH(debug,
|
AC_ARG_WITH(debug,
|
||||||
[ --with-debug add the debugging module (on)])
|
[ --with-debug add the debugging module (on)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_debug" = ""
|
||||||
|
then
|
||||||
|
with_debug=no
|
||||||
|
fi
|
||||||
if test "$with_debug" = "no" ; then
|
if test "$with_debug" = "no" ; then
|
||||||
echo Disabling DEBUG support
|
echo Disabling DEBUG support
|
||||||
WITH_DEBUG=0
|
WITH_DEBUG=0
|
||||||
DEBUG_OBJ=
|
DEBUG_OBJ=
|
||||||
|
TEST_DEBUG=
|
||||||
else
|
else
|
||||||
WITH_DEBUG=1
|
WITH_DEBUG=1
|
||||||
DEBUG_OBJ=debugXML.o
|
DEBUG_OBJ=debugXML.o
|
||||||
|
TEST_DEBUG=Scripttests
|
||||||
fi
|
fi
|
||||||
AC_SUBST(WITH_DEBUG)
|
AC_SUBST(WITH_DEBUG)
|
||||||
AC_SUBST(DEBUG_OBJ)
|
AC_SUBST(DEBUG_OBJ)
|
||||||
|
AC_SUBST(TEST_DEBUG)
|
||||||
|
|
||||||
AC_ARG_WITH(mem_debug,
|
AC_ARG_WITH(mem_debug,
|
||||||
[ --with-mem-debug add the memory debugging module (off)])
|
[ --with-mem-debug add the memory debugging module (off)])
|
||||||
|
if test "$with_minimum" = "yes" -a "$with_mem_debug" = ""
|
||||||
|
then
|
||||||
|
with_mem_debug=no
|
||||||
|
fi
|
||||||
if test "$with_mem_debug" = "yes" ; then
|
if test "$with_mem_debug" = "yes" ; then
|
||||||
echo Enabling memory debug support
|
echo Enabling memory debug support
|
||||||
WITH_MEM_DEBUG=1
|
WITH_MEM_DEBUG=1
|
||||||
|
@ -1380,6 +1380,7 @@
|
|||||||
<exports symbol='xmlTextReaderNodeType'/>
|
<exports symbol='xmlTextReaderNodeType'/>
|
||||||
<exports symbol='xmlTextReaderNormalization'/>
|
<exports symbol='xmlTextReaderNormalization'/>
|
||||||
<exports symbol='xmlTextReaderPrefix'/>
|
<exports symbol='xmlTextReaderPrefix'/>
|
||||||
|
<exports symbol='xmlTextReaderPreserve'/>
|
||||||
<exports symbol='xmlTextReaderPtr'/>
|
<exports symbol='xmlTextReaderPtr'/>
|
||||||
<exports symbol='xmlTextReaderQuoteChar'/>
|
<exports symbol='xmlTextReaderQuoteChar'/>
|
||||||
<exports symbol='xmlTextReaderRead'/>
|
<exports symbol='xmlTextReaderRead'/>
|
||||||
@ -7012,7 +7013,7 @@ actually an xmlCharEncoding'/>
|
|||||||
<arg name='publicID' type='const xmlChar *' info='the public identifier'/>
|
<arg name='publicID' type='const xmlChar *' info='the public identifier'/>
|
||||||
</function>
|
</function>
|
||||||
<function name='xmlKeepBlanksDefault' file='parser'>
|
<function name='xmlKeepBlanksDefault' file='parser'>
|
||||||
<info>Set and return the previous value for default blanks text nodes support. The 1.x version of the parser used an heuristic to try to detect ignorable white spaces. As a result the SAX callback was generating ignorableWhitespace() callbacks instead of characters() one, and when using the DOM output text nodes containing those blanks were not generated. The 2.x and later version will switch to the XML standard way and ignorableWhitespace() are only generated when running the parser in validating mode and when the current element doesn't allow CDATA or mixed content. This function is provided as a way to force the standard behavior on 1.X libs and to switch back to the old mode for compatibility when running 1.X client code on 2.X . Upgrade of 1.X code should be done by using xmlIsBlankNode() commodity function to detect the "empty" nodes generated. This value also affect autogeneration of indentation when saving code if blanks sections are kept, indentation is not generated.</info>
|
<info>Set and return the previous value for default blanks text nodes support. The 1.x version of the parser used an heuristic to try to detect ignorable white spaces. As a result the SAX callback was generating xmlSAX2IgnorableWhitespace() callbacks instead of characters() one, and when using the DOM output text nodes containing those blanks were not generated. The 2.x and later version will switch to the XML standard way and ignorableWhitespace() are only generated when running the parser in validating mode and when the current element doesn't allow CDATA or mixed content. This function is provided as a way to force the standard behavior on 1.X libs and to switch back to the old mode for compatibility when running 1.X client code on 2.X . Upgrade of 1.X code should be done by using xmlIsBlankNode() commodity function to detect the "empty" nodes generated. This value also affect autogeneration of indentation when saving code if blanks sections are kept, indentation is not generated.</info>
|
||||||
<return type='int' info='the last value for 0 for no substitution, 1 for substitution.'/>
|
<return type='int' info='the last value for 0 for no substitution, 1 for substitution.'/>
|
||||||
<arg name='val' type='int' info='int 0 or 1'/>
|
<arg name='val' type='int' info='int 0 or 1'/>
|
||||||
</function>
|
</function>
|
||||||
@ -10064,6 +10065,11 @@ actually an xmlCharEncoding'/>
|
|||||||
<return type='xmlChar *' info='the prefix or NULL if not available'/>
|
<return type='xmlChar *' info='the prefix or NULL if not available'/>
|
||||||
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
|
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
|
||||||
</function>
|
</function>
|
||||||
|
<function name='xmlTextReaderPreserve' file='xmlreader'>
|
||||||
|
<info>current node being accessed by the xmlTextReader. This is dangerous because the underlying node may be destroyed on the next Reads.</info>
|
||||||
|
<return type='xmlNodePtr' info='the xmlNodePtr or NULL in case of error.'/>
|
||||||
|
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
|
||||||
|
</function>
|
||||||
<function name='xmlTextReaderQuoteChar' file='xmlreader'>
|
<function name='xmlTextReaderQuoteChar' file='xmlreader'>
|
||||||
<info>The quotation mark character used to enclose the value of an attribute.</info>
|
<info>The quotation mark character used to enclose the value of an attribute.</info>
|
||||||
<return type='int' info='" or ' and -1 in case of error'/>
|
<return type='int' info='" or ' and -1 in case of error'/>
|
||||||
|
176
entities.c
176
entities.c
@ -412,150 +412,6 @@ xmlGetDocEntity(xmlDocPtr doc, const xmlChar *name) {
|
|||||||
(((c) == 0x09) || ((c) == 0x0a) || ((c) == 0x0d) || \
|
(((c) == 0x09) || ((c) == 0x0a) || ((c) == 0x0d) || \
|
||||||
(((c) >= 0x20) && ((c) != 0xFFFE) && ((c) != 0xFFFF)))
|
(((c) >= 0x20) && ((c) != 0xFFFE) && ((c) != 0xFFFF)))
|
||||||
|
|
||||||
/*
|
|
||||||
* A buffer used for converting entities to their equivalent and back.
|
|
||||||
*/
|
|
||||||
static int static_buffer_size = 0;
|
|
||||||
static xmlChar *static_buffer = NULL;
|
|
||||||
|
|
||||||
static int growBuffer(void) {
|
|
||||||
static_buffer_size *= 2;
|
|
||||||
static_buffer = (xmlChar *) xmlRealloc(static_buffer,
|
|
||||||
static_buffer_size * sizeof(xmlChar));
|
|
||||||
if (static_buffer == NULL) {
|
|
||||||
xmlGenericError(xmlGenericErrorContext, "malloc failed\n");
|
|
||||||
return(-1);
|
|
||||||
}
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xmlEncodeEntities:
|
|
||||||
* @doc: the document containing the string
|
|
||||||
* @input: A string to convert to XML.
|
|
||||||
*
|
|
||||||
* Do a global encoding of a string, replacing the predefined entities
|
|
||||||
* and non ASCII values with their entities and CharRef counterparts.
|
|
||||||
*
|
|
||||||
* TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary
|
|
||||||
* compatibility
|
|
||||||
*
|
|
||||||
* People must migrate their code to xmlEncodeEntitiesReentrant !
|
|
||||||
* This routine will issue a warning when encountered.
|
|
||||||
*
|
|
||||||
* Returns A newly allocated string with the substitution done.
|
|
||||||
*/
|
|
||||||
const xmlChar *
|
|
||||||
xmlEncodeEntities(xmlDocPtr doc, const xmlChar *input) {
|
|
||||||
const xmlChar *cur = input;
|
|
||||||
xmlChar *out = static_buffer;
|
|
||||||
static int warning = 1;
|
|
||||||
int html = 0;
|
|
||||||
|
|
||||||
|
|
||||||
if (warning) {
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"Deprecated API xmlEncodeEntities() used\n");
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
" change code to use xmlEncodeEntitiesReentrant()\n");
|
|
||||||
warning = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (input == NULL) return(NULL);
|
|
||||||
if (doc != NULL)
|
|
||||||
html = (doc->type == XML_HTML_DOCUMENT_NODE);
|
|
||||||
|
|
||||||
if (static_buffer == NULL) {
|
|
||||||
static_buffer_size = 1000;
|
|
||||||
static_buffer = (xmlChar *)
|
|
||||||
xmlMalloc(static_buffer_size * sizeof(xmlChar));
|
|
||||||
if (static_buffer == NULL) {
|
|
||||||
xmlGenericError(xmlGenericErrorContext, "malloc failed\n");
|
|
||||||
return(NULL);
|
|
||||||
}
|
|
||||||
out = static_buffer;
|
|
||||||
}
|
|
||||||
while (*cur != '\0') {
|
|
||||||
if (out - static_buffer > static_buffer_size - 100) {
|
|
||||||
int indx = out - static_buffer;
|
|
||||||
|
|
||||||
growBuffer();
|
|
||||||
out = &static_buffer[indx];
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* By default one have to encode at least '<', '>', '"' and '&' !
|
|
||||||
*/
|
|
||||||
if (*cur == '<') {
|
|
||||||
*out++ = '&';
|
|
||||||
*out++ = 'l';
|
|
||||||
*out++ = 't';
|
|
||||||
*out++ = ';';
|
|
||||||
} else if (*cur == '>') {
|
|
||||||
*out++ = '&';
|
|
||||||
*out++ = 'g';
|
|
||||||
*out++ = 't';
|
|
||||||
*out++ = ';';
|
|
||||||
} else if (*cur == '&') {
|
|
||||||
*out++ = '&';
|
|
||||||
*out++ = 'a';
|
|
||||||
*out++ = 'm';
|
|
||||||
*out++ = 'p';
|
|
||||||
*out++ = ';';
|
|
||||||
} else if (*cur == '"') {
|
|
||||||
*out++ = '&';
|
|
||||||
*out++ = 'q';
|
|
||||||
*out++ = 'u';
|
|
||||||
*out++ = 'o';
|
|
||||||
*out++ = 't';
|
|
||||||
*out++ = ';';
|
|
||||||
} else if ((*cur == '\'') && (!html)) {
|
|
||||||
*out++ = '&';
|
|
||||||
*out++ = 'a';
|
|
||||||
*out++ = 'p';
|
|
||||||
*out++ = 'o';
|
|
||||||
*out++ = 's';
|
|
||||||
*out++ = ';';
|
|
||||||
} else if (((*cur >= 0x20) && (*cur < 0x80)) ||
|
|
||||||
(*cur == '\n') || (*cur == '\r') || (*cur == '\t')) {
|
|
||||||
/*
|
|
||||||
* default case, just copy !
|
|
||||||
*/
|
|
||||||
*out++ = *cur;
|
|
||||||
#ifndef USE_UTF_8
|
|
||||||
} else if ((sizeof(xmlChar) == 1) && (*cur >= 0x80)) {
|
|
||||||
char buf[10], *ptr;
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "&#%d;", *cur);
|
|
||||||
buf[sizeof(buf) - 1] = 0;
|
|
||||||
ptr = buf;
|
|
||||||
while (*ptr != 0) *out++ = *ptr++;
|
|
||||||
#endif
|
|
||||||
} else if (IS_CHAR((unsigned int) *cur)) {
|
|
||||||
char buf[10], *ptr;
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "&#%d;", *cur);
|
|
||||||
buf[sizeof(buf) - 1] = 0;
|
|
||||||
ptr = buf;
|
|
||||||
while (*ptr != 0) *out++ = *ptr++;
|
|
||||||
}
|
|
||||||
#if 0
|
|
||||||
else {
|
|
||||||
/*
|
|
||||||
* default case, this is not a valid char !
|
|
||||||
* Skip it...
|
|
||||||
*/
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlEncodeEntities: invalid char %d\n", (int) *cur);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
cur++;
|
|
||||||
}
|
|
||||||
*out++ = 0;
|
|
||||||
return(static_buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Macro used to grow the current buffer.
|
* Macro used to grow the current buffer.
|
||||||
*/
|
*/
|
||||||
@ -632,22 +488,6 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
|
|||||||
*out++ = 'm';
|
*out++ = 'm';
|
||||||
*out++ = 'p';
|
*out++ = 'p';
|
||||||
*out++ = ';';
|
*out++ = ';';
|
||||||
#if 0
|
|
||||||
} else if (*cur == '"') {
|
|
||||||
*out++ = '&';
|
|
||||||
*out++ = 'q';
|
|
||||||
*out++ = 'u';
|
|
||||||
*out++ = 'o';
|
|
||||||
*out++ = 't';
|
|
||||||
*out++ = ';';
|
|
||||||
} else if ((*cur == '\'') && (!html)) {
|
|
||||||
*out++ = '&';
|
|
||||||
*out++ = 'a';
|
|
||||||
*out++ = 'p';
|
|
||||||
*out++ = 'o';
|
|
||||||
*out++ = 's';
|
|
||||||
*out++ = ';';
|
|
||||||
#endif
|
|
||||||
} else if (((*cur >= 0x20) && (*cur < 0x80)) ||
|
} else if (((*cur >= 0x20) && (*cur < 0x80)) ||
|
||||||
(*cur == '\n') || (*cur == '\t') || ((html) && (*cur == '\r'))) {
|
(*cur == '\n') || (*cur == '\t') || ((html) && (*cur == '\r'))) {
|
||||||
/*
|
/*
|
||||||
@ -739,16 +579,6 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
|
|||||||
ptr = buf;
|
ptr = buf;
|
||||||
while (*ptr != 0) *out++ = *ptr++;
|
while (*ptr != 0) *out++ = *ptr++;
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
else {
|
|
||||||
/*
|
|
||||||
* default case, this is not a valid char !
|
|
||||||
* Skip it...
|
|
||||||
*/
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlEncodeEntities: invalid char %d\n", (int) *cur);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
cur++;
|
cur++;
|
||||||
}
|
}
|
||||||
*out++ = 0;
|
*out++ = 0;
|
||||||
@ -771,12 +601,6 @@ xmlEncodeSpecialChars(xmlDocPtr doc ATTRIBUTE_UNUSED, const xmlChar *input) {
|
|||||||
xmlChar *buffer = NULL;
|
xmlChar *buffer = NULL;
|
||||||
xmlChar *out = NULL;
|
xmlChar *out = NULL;
|
||||||
int buffer_size = 0;
|
int buffer_size = 0;
|
||||||
#if 0
|
|
||||||
int html = 0;
|
|
||||||
|
|
||||||
if (doc != NULL)
|
|
||||||
html = (doc->type == XML_HTML_DOCUMENT_NODE);
|
|
||||||
#endif
|
|
||||||
if (input == NULL) return(NULL);
|
if (input == NULL) return(NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -484,10 +484,10 @@ xmlInitializeGlobalState(xmlGlobalStatePtr gs)
|
|||||||
gs->xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef;
|
gs->xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef;
|
||||||
gs->xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef;
|
gs->xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef;
|
||||||
initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
|
initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
|
||||||
gs->xmlDefaultSAXLocator.getPublicId = getPublicId;
|
gs->xmlDefaultSAXLocator.getPublicId = xmlSAX2GetPublicId;
|
||||||
gs->xmlDefaultSAXLocator.getSystemId = getSystemId;
|
gs->xmlDefaultSAXLocator.getSystemId = xmlSAX2GetSystemId;
|
||||||
gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber;
|
gs->xmlDefaultSAXLocator.getLineNumber = xmlSAX2GetLineNumber;
|
||||||
gs->xmlDefaultSAXLocator.getColumnNumber = getColumnNumber;
|
gs->xmlDefaultSAXLocator.getColumnNumber = xmlSAX2GetColumnNumber;
|
||||||
gs->xmlDoValidityCheckingDefaultValue =
|
gs->xmlDoValidityCheckingDefaultValue =
|
||||||
xmlDoValidityCheckingDefaultValueThrDef;
|
xmlDoValidityCheckingDefaultValueThrDef;
|
||||||
#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
|
#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
|
||||||
|
@ -101,6 +101,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
|
|||||||
#define LIBXML_HTTP_ENABLED
|
#define LIBXML_HTTP_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LIBXML_VALID_ENABLED:
|
||||||
|
*
|
||||||
|
* Whether the DTD validation support is configured in
|
||||||
|
*/
|
||||||
|
#if @WITH_VALID@
|
||||||
|
#define LIBXML_VALID_ENABLED
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LIBXML_HTML_ENABLED:
|
* LIBXML_HTML_ENABLED:
|
||||||
*
|
*
|
||||||
@ -110,6 +119,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
|
|||||||
#define LIBXML_HTML_ENABLED
|
#define LIBXML_HTML_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LIBXML_LEGACY_ENABLED:
|
||||||
|
*
|
||||||
|
* Whether the deprecated APIs are compiled in for compatibility
|
||||||
|
*/
|
||||||
|
#if @WITH_LEGACY@
|
||||||
|
#define LIBXML_LEGACY_ENABLED
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LIBXML_C14N_ENABLED:
|
* LIBXML_C14N_ENABLED:
|
||||||
*
|
*
|
||||||
|
83
parser.c
83
parser.c
@ -657,6 +657,78 @@ mem_error:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xmlCheckLanguageID:
|
||||||
|
* @lang: pointer to the string value
|
||||||
|
*
|
||||||
|
* Checks that the value conforms to the LanguageID production:
|
||||||
|
*
|
||||||
|
* NOTE: this is somewhat deprecated, those productions were removed from
|
||||||
|
* the XML Second edition.
|
||||||
|
*
|
||||||
|
* [33] LanguageID ::= Langcode ('-' Subcode)*
|
||||||
|
* [34] Langcode ::= ISO639Code | IanaCode | UserCode
|
||||||
|
* [35] ISO639Code ::= ([a-z] | [A-Z]) ([a-z] | [A-Z])
|
||||||
|
* [36] IanaCode ::= ('i' | 'I') '-' ([a-z] | [A-Z])+
|
||||||
|
* [37] UserCode ::= ('x' | 'X') '-' ([a-z] | [A-Z])+
|
||||||
|
* [38] Subcode ::= ([a-z] | [A-Z])+
|
||||||
|
*
|
||||||
|
* Returns 1 if correct 0 otherwise
|
||||||
|
**/
|
||||||
|
int
|
||||||
|
xmlCheckLanguageID(const xmlChar * lang)
|
||||||
|
{
|
||||||
|
const xmlChar *cur = lang;
|
||||||
|
|
||||||
|
if (cur == NULL)
|
||||||
|
return (0);
|
||||||
|
if (((cur[0] == 'i') && (cur[1] == '-')) ||
|
||||||
|
((cur[0] == 'I') && (cur[1] == '-'))) {
|
||||||
|
/*
|
||||||
|
* IANA code
|
||||||
|
*/
|
||||||
|
cur += 2;
|
||||||
|
while (((cur[0] >= 'A') && (cur[0] <= 'Z')) || /* non input consuming */
|
||||||
|
((cur[0] >= 'a') && (cur[0] <= 'z')))
|
||||||
|
cur++;
|
||||||
|
} else if (((cur[0] == 'x') && (cur[1] == '-')) ||
|
||||||
|
((cur[0] == 'X') && (cur[1] == '-'))) {
|
||||||
|
/*
|
||||||
|
* User code
|
||||||
|
*/
|
||||||
|
cur += 2;
|
||||||
|
while (((cur[0] >= 'A') && (cur[0] <= 'Z')) || /* non input consuming */
|
||||||
|
((cur[0] >= 'a') && (cur[0] <= 'z')))
|
||||||
|
cur++;
|
||||||
|
} else if (((cur[0] >= 'A') && (cur[0] <= 'Z')) ||
|
||||||
|
((cur[0] >= 'a') && (cur[0] <= 'z'))) {
|
||||||
|
/*
|
||||||
|
* ISO639
|
||||||
|
*/
|
||||||
|
cur++;
|
||||||
|
if (((cur[0] >= 'A') && (cur[0] <= 'Z')) ||
|
||||||
|
((cur[0] >= 'a') && (cur[0] <= 'z')))
|
||||||
|
cur++;
|
||||||
|
else
|
||||||
|
return (0);
|
||||||
|
} else
|
||||||
|
return (0);
|
||||||
|
while (cur[0] != 0) { /* non input consuming */
|
||||||
|
if (cur[0] != '-')
|
||||||
|
return (0);
|
||||||
|
cur++;
|
||||||
|
if (((cur[0] >= 'A') && (cur[0] <= 'Z')) ||
|
||||||
|
((cur[0] >= 'a') && (cur[0] <= 'z')))
|
||||||
|
cur++;
|
||||||
|
else
|
||||||
|
return (0);
|
||||||
|
while (((cur[0] >= 'A') && (cur[0] <= 'Z')) || /* non input consuming */
|
||||||
|
((cur[0] >= 'a') && (cur[0] <= 'z')))
|
||||||
|
cur++;
|
||||||
|
}
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
* Parser stacks related functions and macros *
|
* Parser stacks related functions and macros *
|
||||||
@ -8185,6 +8257,7 @@ xmlParseElement(xmlParserCtxtPtr ctxt) {
|
|||||||
namePush(ctxt, name);
|
namePush(ctxt, name);
|
||||||
ret = ctxt->node;
|
ret = ctxt->node;
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/*
|
/*
|
||||||
* [ VC: Root Element Type ]
|
* [ VC: Root Element Type ]
|
||||||
* The Name in the document type declaration must match the element
|
* The Name in the document type declaration must match the element
|
||||||
@ -8193,6 +8266,7 @@ xmlParseElement(xmlParserCtxtPtr ctxt) {
|
|||||||
if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
|
if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
|
||||||
ctxt->node && (ctxt->node == ctxt->myDoc->children))
|
ctxt->node && (ctxt->node == ctxt->myDoc->children))
|
||||||
ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
|
ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for an Empty Element.
|
* Check for an Empty Element.
|
||||||
@ -9406,6 +9480,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
|
|||||||
ctxt->sax->endDocument(ctxt->userData);
|
ctxt->sax->endDocument(ctxt->userData);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/*
|
/*
|
||||||
* [ VC: Root Element Type ]
|
* [ VC: Root Element Type ]
|
||||||
* The Name in the document type declaration must match
|
* The Name in the document type declaration must match
|
||||||
@ -9414,6 +9489,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
|
|||||||
if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
|
if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
|
||||||
ctxt->node && (ctxt->node == ctxt->myDoc->children))
|
ctxt->node && (ctxt->node == ctxt->myDoc->children))
|
||||||
ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
|
ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for an Empty Element.
|
* Check for an Empty Element.
|
||||||
@ -10219,6 +10295,7 @@ xmlCreateIOParserCtxt(xmlSAXHandlerPtr sax, void *user_data,
|
|||||||
return(ctxt);
|
return(ctxt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
* Front ends when parsing a DTD *
|
* Front ends when parsing a DTD *
|
||||||
@ -10437,6 +10514,7 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID,
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlParseDTD:
|
* xmlParseDTD:
|
||||||
* @ExternalID: a NAME* containing the External ID of the DTD
|
* @ExternalID: a NAME* containing the External ID of the DTD
|
||||||
@ -10451,6 +10529,7 @@ xmlDtdPtr
|
|||||||
xmlParseDTD(const xmlChar *ExternalID, const xmlChar *SystemID) {
|
xmlParseDTD(const xmlChar *ExternalID, const xmlChar *SystemID) {
|
||||||
return(xmlSAXParseDTD(NULL, ExternalID, SystemID));
|
return(xmlSAXParseDTD(NULL, ExternalID, SystemID));
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -10985,11 +11064,13 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
|
|||||||
cur = ctxt->myDoc->children->children;
|
cur = ctxt->myDoc->children->children;
|
||||||
*lst = cur;
|
*lst = cur;
|
||||||
while (cur != NULL) {
|
while (cur != NULL) {
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if (oldctxt->validate && oldctxt->wellFormed &&
|
if (oldctxt->validate && oldctxt->wellFormed &&
|
||||||
oldctxt->myDoc && oldctxt->myDoc->intSubset) {
|
oldctxt->myDoc && oldctxt->myDoc->intSubset) {
|
||||||
oldctxt->valid &= xmlValidateElement(&oldctxt->vctxt,
|
oldctxt->valid &= xmlValidateElement(&oldctxt->vctxt,
|
||||||
oldctxt->myDoc, cur);
|
oldctxt->myDoc, cur);
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
cur->parent = NULL;
|
cur->parent = NULL;
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
}
|
}
|
||||||
@ -12024,8 +12105,10 @@ xmlCtxtReset(xmlParserCtxtPtr ctxt)
|
|||||||
ctxt->attsSpecial = NULL;
|
ctxt->attsSpecial = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_CATALOG_ENABLED
|
||||||
if (ctxt->catalogs != NULL)
|
if (ctxt->catalogs != NULL)
|
||||||
xmlCatalogFreeLocal(ctxt->catalogs);
|
xmlCatalogFreeLocal(ctxt->catalogs);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,8 +54,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <libxml/globals.h>
|
#include <libxml/globals.h>
|
||||||
|
|
||||||
void xmlUpgradeOldNs(xmlDocPtr doc);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Various global defaults for parsing
|
* Various global defaults for parsing
|
||||||
*/
|
*/
|
||||||
@ -2713,405 +2711,3 @@ xmlKeepBlanksDefault(int val) {
|
|||||||
return(old);
|
return(old);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* *
|
|
||||||
* Deprecated functions kept for compatibility *
|
|
||||||
* *
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xmlCheckLanguageID:
|
|
||||||
* @lang: pointer to the string value
|
|
||||||
*
|
|
||||||
* Checks that the value conforms to the LanguageID production:
|
|
||||||
*
|
|
||||||
* NOTE: this is somewhat deprecated, those productions were removed from
|
|
||||||
* the XML Second edition.
|
|
||||||
*
|
|
||||||
* [33] LanguageID ::= Langcode ('-' Subcode)*
|
|
||||||
* [34] Langcode ::= ISO639Code | IanaCode | UserCode
|
|
||||||
* [35] ISO639Code ::= ([a-z] | [A-Z]) ([a-z] | [A-Z])
|
|
||||||
* [36] IanaCode ::= ('i' | 'I') '-' ([a-z] | [A-Z])+
|
|
||||||
* [37] UserCode ::= ('x' | 'X') '-' ([a-z] | [A-Z])+
|
|
||||||
* [38] Subcode ::= ([a-z] | [A-Z])+
|
|
||||||
*
|
|
||||||
* Returns 1 if correct 0 otherwise
|
|
||||||
**/
|
|
||||||
int
|
|
||||||
xmlCheckLanguageID(const xmlChar * lang)
|
|
||||||
{
|
|
||||||
const xmlChar *cur = lang;
|
|
||||||
|
|
||||||
if (cur == NULL)
|
|
||||||
return (0);
|
|
||||||
if (((cur[0] == 'i') && (cur[1] == '-')) ||
|
|
||||||
((cur[0] == 'I') && (cur[1] == '-'))) {
|
|
||||||
/*
|
|
||||||
* IANA code
|
|
||||||
*/
|
|
||||||
cur += 2;
|
|
||||||
while (((cur[0] >= 'A') && (cur[0] <= 'Z')) || /* non input consuming */
|
|
||||||
((cur[0] >= 'a') && (cur[0] <= 'z')))
|
|
||||||
cur++;
|
|
||||||
} else if (((cur[0] == 'x') && (cur[1] == '-')) ||
|
|
||||||
((cur[0] == 'X') && (cur[1] == '-'))) {
|
|
||||||
/*
|
|
||||||
* User code
|
|
||||||
*/
|
|
||||||
cur += 2;
|
|
||||||
while (((cur[0] >= 'A') && (cur[0] <= 'Z')) || /* non input consuming */
|
|
||||||
((cur[0] >= 'a') && (cur[0] <= 'z')))
|
|
||||||
cur++;
|
|
||||||
} else if (((cur[0] >= 'A') && (cur[0] <= 'Z')) ||
|
|
||||||
((cur[0] >= 'a') && (cur[0] <= 'z'))) {
|
|
||||||
/*
|
|
||||||
* ISO639
|
|
||||||
*/
|
|
||||||
cur++;
|
|
||||||
if (((cur[0] >= 'A') && (cur[0] <= 'Z')) ||
|
|
||||||
((cur[0] >= 'a') && (cur[0] <= 'z')))
|
|
||||||
cur++;
|
|
||||||
else
|
|
||||||
return (0);
|
|
||||||
} else
|
|
||||||
return (0);
|
|
||||||
while (cur[0] != 0) { /* non input consuming */
|
|
||||||
if (cur[0] != '-')
|
|
||||||
return (0);
|
|
||||||
cur++;
|
|
||||||
if (((cur[0] >= 'A') && (cur[0] <= 'Z')) ||
|
|
||||||
((cur[0] >= 'a') && (cur[0] <= 'z')))
|
|
||||||
cur++;
|
|
||||||
else
|
|
||||||
return (0);
|
|
||||||
while (((cur[0] >= 'A') && (cur[0] <= 'Z')) || /* non input consuming */
|
|
||||||
((cur[0] >= 'a') && (cur[0] <= 'z')))
|
|
||||||
cur++;
|
|
||||||
}
|
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xmlDecodeEntities:
|
|
||||||
* @ctxt: the parser context
|
|
||||||
* @len: the len to decode (in bytes !), -1 for no size limit
|
|
||||||
* @what: combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF
|
|
||||||
* @end: an end marker xmlChar, 0 if none
|
|
||||||
* @end2: an end marker xmlChar, 0 if none
|
|
||||||
* @end3: an end marker xmlChar, 0 if none
|
|
||||||
*
|
|
||||||
* This function is deprecated, we now always process entities content
|
|
||||||
* through xmlStringDecodeEntities
|
|
||||||
*
|
|
||||||
* TODO: remove it in next major release.
|
|
||||||
*
|
|
||||||
* [67] Reference ::= EntityRef | CharRef
|
|
||||||
*
|
|
||||||
* [69] PEReference ::= '%' Name ';'
|
|
||||||
*
|
|
||||||
* Returns A newly allocated string with the substitution done. The caller
|
|
||||||
* must deallocate it !
|
|
||||||
*/
|
|
||||||
xmlChar *
|
|
||||||
xmlDecodeEntities(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
|
|
||||||
int len ATTRIBUTE_UNUSED, int what ATTRIBUTE_UNUSED,
|
|
||||||
xmlChar end ATTRIBUTE_UNUSED,
|
|
||||||
xmlChar end2 ATTRIBUTE_UNUSED,
|
|
||||||
xmlChar end3 ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
static int deprecated = 0;
|
|
||||||
|
|
||||||
if (!deprecated) {
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlDecodeEntities() deprecated function reached\n");
|
|
||||||
deprecated = 1;
|
|
||||||
}
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xmlNamespaceParseNCName:
|
|
||||||
* @ctxt: an XML parser context
|
|
||||||
*
|
|
||||||
* parse an XML namespace name.
|
|
||||||
*
|
|
||||||
* TODO: this seems not in use anymore, the namespace handling is done on
|
|
||||||
* top of the SAX interfaces, i.e. not on raw input.
|
|
||||||
*
|
|
||||||
* [NS 3] NCName ::= (Letter | '_') (NCNameChar)*
|
|
||||||
*
|
|
||||||
* [NS 4] NCNameChar ::= Letter | Digit | '.' | '-' | '_' |
|
|
||||||
* CombiningChar | Extender
|
|
||||||
*
|
|
||||||
* Returns the namespace name or NULL
|
|
||||||
*/
|
|
||||||
|
|
||||||
xmlChar *
|
|
||||||
xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
static int deprecated = 0;
|
|
||||||
|
|
||||||
if (!deprecated) {
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlNamespaceParseNCName() deprecated function reached\n");
|
|
||||||
deprecated = 1;
|
|
||||||
}
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xmlNamespaceParseQName:
|
|
||||||
* @ctxt: an XML parser context
|
|
||||||
* @prefix: a xmlChar **
|
|
||||||
*
|
|
||||||
* TODO: this seems not in use anymore, the namespace handling is done on
|
|
||||||
* top of the SAX interfaces, i.e. not on raw input.
|
|
||||||
*
|
|
||||||
* parse an XML qualified name
|
|
||||||
*
|
|
||||||
* [NS 5] QName ::= (Prefix ':')? LocalPart
|
|
||||||
*
|
|
||||||
* [NS 6] Prefix ::= NCName
|
|
||||||
*
|
|
||||||
* [NS 7] LocalPart ::= NCName
|
|
||||||
*
|
|
||||||
* Returns the local part, and prefix is updated
|
|
||||||
* to get the Prefix if any.
|
|
||||||
*/
|
|
||||||
|
|
||||||
xmlChar *
|
|
||||||
xmlNamespaceParseQName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
|
|
||||||
xmlChar ** prefix ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
|
|
||||||
static int deprecated = 0;
|
|
||||||
|
|
||||||
if (!deprecated) {
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlNamespaceParseQName() deprecated function reached\n");
|
|
||||||
deprecated = 1;
|
|
||||||
}
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xmlNamespaceParseNSDef:
|
|
||||||
* @ctxt: an XML parser context
|
|
||||||
*
|
|
||||||
* parse a namespace prefix declaration
|
|
||||||
*
|
|
||||||
* TODO: this seems not in use anymore, the namespace handling is done on
|
|
||||||
* top of the SAX interfaces, i.e. not on raw input.
|
|
||||||
*
|
|
||||||
* [NS 1] NSDef ::= PrefixDef Eq SystemLiteral
|
|
||||||
*
|
|
||||||
* [NS 2] PrefixDef ::= 'xmlns' (':' NCName)?
|
|
||||||
*
|
|
||||||
* Returns the namespace name
|
|
||||||
*/
|
|
||||||
|
|
||||||
xmlChar *
|
|
||||||
xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
static int deprecated = 0;
|
|
||||||
|
|
||||||
if (!deprecated) {
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlNamespaceParseNSDef() deprecated function reached\n");
|
|
||||||
deprecated = 1;
|
|
||||||
}
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xmlParseQuotedString:
|
|
||||||
* @ctxt: an XML parser context
|
|
||||||
*
|
|
||||||
* Parse and return a string between quotes or doublequotes
|
|
||||||
*
|
|
||||||
* TODO: Deprecated, to be removed at next drop of binary compatibility
|
|
||||||
*
|
|
||||||
* Returns the string parser or NULL.
|
|
||||||
*/
|
|
||||||
xmlChar *
|
|
||||||
xmlParseQuotedString(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
static int deprecated = 0;
|
|
||||||
|
|
||||||
if (!deprecated) {
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlParseQuotedString() deprecated function reached\n");
|
|
||||||
deprecated = 1;
|
|
||||||
}
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xmlParseNamespace:
|
|
||||||
* @ctxt: an XML parser context
|
|
||||||
*
|
|
||||||
* xmlParseNamespace: parse specific PI '<?namespace ...' constructs.
|
|
||||||
*
|
|
||||||
* This is what the older xml-name Working Draft specified, a bunch of
|
|
||||||
* other stuff may still rely on it, so support is still here as
|
|
||||||
* if it was declared on the root of the Tree:-(
|
|
||||||
*
|
|
||||||
* TODO: remove from library
|
|
||||||
*
|
|
||||||
* To be removed at next drop of binary compatibility
|
|
||||||
*/
|
|
||||||
|
|
||||||
void
|
|
||||||
xmlParseNamespace(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
static int deprecated = 0;
|
|
||||||
|
|
||||||
if (!deprecated) {
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlParseNamespace() deprecated function reached\n");
|
|
||||||
deprecated = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xmlScanName:
|
|
||||||
* @ctxt: an XML parser context
|
|
||||||
*
|
|
||||||
* Trickery: parse an XML name but without consuming the input flow
|
|
||||||
* Needed for rollback cases. Used only when parsing entities references.
|
|
||||||
*
|
|
||||||
* TODO: seems deprecated now, only used in the default part of
|
|
||||||
* xmlParserHandleReference
|
|
||||||
*
|
|
||||||
* [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
|
|
||||||
* CombiningChar | Extender
|
|
||||||
*
|
|
||||||
* [5] Name ::= (Letter | '_' | ':') (NameChar)*
|
|
||||||
*
|
|
||||||
* [6] Names ::= Name (S Name)*
|
|
||||||
*
|
|
||||||
* Returns the Name parsed or NULL
|
|
||||||
*/
|
|
||||||
|
|
||||||
xmlChar *
|
|
||||||
xmlScanName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
static int deprecated = 0;
|
|
||||||
|
|
||||||
if (!deprecated) {
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlScanName() deprecated function reached\n");
|
|
||||||
deprecated = 1;
|
|
||||||
}
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xmlParserHandleReference:
|
|
||||||
* @ctxt: the parser context
|
|
||||||
*
|
|
||||||
* TODO: Remove, now deprecated ... the test is done directly in the
|
|
||||||
* content parsing
|
|
||||||
* routines.
|
|
||||||
*
|
|
||||||
* [67] Reference ::= EntityRef | CharRef
|
|
||||||
*
|
|
||||||
* [68] EntityRef ::= '&' Name ';'
|
|
||||||
*
|
|
||||||
* [ WFC: Entity Declared ]
|
|
||||||
* the Name given in the entity reference must match that in an entity
|
|
||||||
* declaration, except that well-formed documents need not declare any
|
|
||||||
* of the following entities: amp, lt, gt, apos, quot.
|
|
||||||
*
|
|
||||||
* [ WFC: Parsed Entity ]
|
|
||||||
* An entity reference must not contain the name of an unparsed entity
|
|
||||||
*
|
|
||||||
* [66] CharRef ::= '&#' [0-9]+ ';' |
|
|
||||||
* '&#x' [0-9a-fA-F]+ ';'
|
|
||||||
*
|
|
||||||
* A PEReference may have been detected in the current input stream
|
|
||||||
* the handling is done accordingly to
|
|
||||||
* http://www.w3.org/TR/REC-xml#entproc
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
xmlParserHandleReference(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
static int deprecated = 0;
|
|
||||||
|
|
||||||
if (!deprecated) {
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlParserHandleReference() deprecated function reached\n");
|
|
||||||
deprecated = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xmlHandleEntity:
|
|
||||||
* @ctxt: an XML parser context
|
|
||||||
* @entity: an XML entity pointer.
|
|
||||||
*
|
|
||||||
* Default handling of defined entities, when should we define a new input
|
|
||||||
* stream ? When do we just handle that as a set of chars ?
|
|
||||||
*
|
|
||||||
* OBSOLETE: to be removed at some point.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void
|
|
||||||
xmlHandleEntity(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
|
|
||||||
xmlEntityPtr entity ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
static int deprecated = 0;
|
|
||||||
|
|
||||||
if (!deprecated) {
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlHandleEntity() deprecated function reached\n");
|
|
||||||
deprecated = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xmlNewGlobalNs:
|
|
||||||
* @doc: the document carrying the namespace
|
|
||||||
* @href: the URI associated
|
|
||||||
* @prefix: the prefix for the namespace
|
|
||||||
*
|
|
||||||
* Creation of a Namespace, the old way using PI and without scoping
|
|
||||||
* DEPRECATED !!!
|
|
||||||
* It now create a namespace on the root element of the document if found.
|
|
||||||
* Returns NULL this functionality had been removed
|
|
||||||
*/
|
|
||||||
xmlNsPtr
|
|
||||||
xmlNewGlobalNs(xmlDocPtr doc ATTRIBUTE_UNUSED,
|
|
||||||
const xmlChar * href ATTRIBUTE_UNUSED,
|
|
||||||
const xmlChar * prefix ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
static int deprecated = 0;
|
|
||||||
|
|
||||||
if (!deprecated) {
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlNewGlobalNs() deprecated function reached\n");
|
|
||||||
deprecated = 1;
|
|
||||||
}
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xmlUpgradeOldNs:
|
|
||||||
* @doc: a document pointer
|
|
||||||
*
|
|
||||||
* Upgrade old style Namespaces (PI) and move them to the root of the document.
|
|
||||||
* DEPRECATED
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
xmlUpgradeOldNs(xmlDocPtr doc ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
static int deprecated = 0;
|
|
||||||
|
|
||||||
if (!deprecated) {
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlUpgradeOldNs() deprecated function reached\n");
|
|
||||||
deprecated = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -693,6 +693,7 @@ Class xmlTextReader(xmlTextReaderCore)
|
|||||||
NodeType()
|
NodeType()
|
||||||
Normalization()
|
Normalization()
|
||||||
Prefix()
|
Prefix()
|
||||||
|
Preserve()
|
||||||
QuoteChar()
|
QuoteChar()
|
||||||
Read()
|
Read()
|
||||||
ReadAttributeValue()
|
ReadAttributeValue()
|
||||||
|
@ -229,7 +229,7 @@ res=""
|
|||||||
err=""
|
err=""
|
||||||
|
|
||||||
input = libxml2.inputBuffer(StringIO.StringIO(s))
|
input = libxml2.inputBuffer(StringIO.StringIO(s))
|
||||||
reader = input.newTextReader("test4")
|
reader = input.newTextReader("test5")
|
||||||
reader.SetParserProp(libxml2.PARSER_VALIDATE,1)
|
reader.SetParserProp(libxml2.PARSER_VALIDATE,1)
|
||||||
while reader.Read() == 1:
|
while reader.Read() == 1:
|
||||||
res = res + "%s %s %d\n" % (reader.NodeType(),reader.Name(),reader.Depth())
|
res = res + "%s %s %d\n" % (reader.NodeType(),reader.Name(),reader.Depth())
|
||||||
|
2
tree.c
2
tree.c
@ -7062,9 +7062,11 @@ xmlElemDump(FILE * f, xmlDocPtr doc, xmlNodePtr cur)
|
|||||||
* *
|
* *
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
|
#ifdef LIBXML_HTML_ENABLED
|
||||||
static void
|
static void
|
||||||
xhtmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
|
xhtmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
|
||||||
int level, int format, const char *encoding);
|
int level, int format, const char *encoding);
|
||||||
|
#endif
|
||||||
static void
|
static void
|
||||||
xmlNodeListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
|
xmlNodeListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
|
||||||
int level, int format, const char *encoding);
|
int level, int format, const char *encoding);
|
||||||
|
30
valid.c
30
valid.c
@ -25,6 +25,10 @@
|
|||||||
#include <libxml/list.h>
|
#include <libxml/list.h>
|
||||||
#include <libxml/globals.h>
|
#include <libxml/globals.h>
|
||||||
|
|
||||||
|
static xmlElementPtr xmlGetDtdElementDesc2(xmlDtdPtr dtd, const xmlChar *name,
|
||||||
|
int create);
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
|
|
||||||
/* #define DEBUG_VALID_ALGO */
|
/* #define DEBUG_VALID_ALGO */
|
||||||
/* #define DEBUG_REGEXP_ALGO */
|
/* #define DEBUG_REGEXP_ALGO */
|
||||||
|
|
||||||
@ -449,8 +453,6 @@ xmlValidStateDebug(xmlValidCtxtPtr ctxt) {
|
|||||||
else if ((doc->intSubset == NULL) && \
|
else if ((doc->intSubset == NULL) && \
|
||||||
(doc->extSubset == NULL)) return(0)
|
(doc->extSubset == NULL)) return(0)
|
||||||
|
|
||||||
static xmlElementPtr xmlGetDtdElementDesc2(xmlDtdPtr dtd, const xmlChar *name,
|
|
||||||
int create);
|
|
||||||
xmlAttributePtr xmlScanAttributeDecl(xmlDtdPtr dtd, const xmlChar *elem);
|
xmlAttributePtr xmlScanAttributeDecl(xmlDtdPtr dtd, const xmlChar *elem);
|
||||||
|
|
||||||
#ifdef LIBXML_REGEXP_ENABLED
|
#ifdef LIBXML_REGEXP_ENABLED
|
||||||
@ -709,6 +711,8 @@ xmlFreeValidCtxt(xmlValidCtxtPtr cur) {
|
|||||||
xmlFree(cur);
|
xmlFree(cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlNewElementContent:
|
* xmlNewElementContent:
|
||||||
* @name: the subelement name or NULL
|
* @name: the subelement name or NULL
|
||||||
@ -1160,10 +1164,12 @@ xmlAddElementDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name,
|
|||||||
ret = xmlHashLookup2(table, name, ns);
|
ret = xmlHashLookup2(table, name, ns);
|
||||||
if (ret != NULL) {
|
if (ret != NULL) {
|
||||||
if (ret->etype != XML_ELEMENT_TYPE_UNDEFINED) {
|
if (ret->etype != XML_ELEMENT_TYPE_UNDEFINED) {
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/*
|
/*
|
||||||
* The element is already defined in this DTD.
|
* The element is already defined in this DTD.
|
||||||
*/
|
*/
|
||||||
VERROR(ctxt->userData, "Redefinition of element %s\n", name);
|
VERROR(ctxt->userData, "Redefinition of element %s\n", name);
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
if (uqname != NULL)
|
if (uqname != NULL)
|
||||||
xmlFree(uqname);
|
xmlFree(uqname);
|
||||||
if (ns != NULL)
|
if (ns != NULL)
|
||||||
@ -1205,10 +1211,12 @@ xmlAddElementDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name,
|
|||||||
* Insertion must not fail
|
* Insertion must not fail
|
||||||
*/
|
*/
|
||||||
if (xmlHashAddEntry2(table, name, ns, ret)) {
|
if (xmlHashAddEntry2(table, name, ns, ret)) {
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/*
|
/*
|
||||||
* The element is already defined in this DTD.
|
* The element is already defined in this DTD.
|
||||||
*/
|
*/
|
||||||
VERROR(ctxt->userData, "Redefinition of element %s\n", name);
|
VERROR(ctxt->userData, "Redefinition of element %s\n", name);
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
xmlFreeElement(ret);
|
xmlFreeElement(ret);
|
||||||
if (uqname != NULL)
|
if (uqname != NULL)
|
||||||
xmlFree(uqname);
|
xmlFree(uqname);
|
||||||
@ -1472,6 +1480,7 @@ xmlCreateAttributeTable(void) {
|
|||||||
return(xmlHashCreate(0));
|
return(xmlHashCreate(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/**
|
/**
|
||||||
* xmlScanAttributeDeclCallback:
|
* xmlScanAttributeDeclCallback:
|
||||||
* @attr: the attribute decl
|
* @attr: the attribute decl
|
||||||
@ -1552,6 +1561,7 @@ xmlScanIDAttributeDecl(xmlValidCtxtPtr ctxt, xmlElementPtr elem) {
|
|||||||
}
|
}
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlFreeAttribute:
|
* xmlFreeAttribute:
|
||||||
@ -1622,6 +1632,7 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *elem,
|
|||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/*
|
/*
|
||||||
* Check the type and possibly the default value.
|
* Check the type and possibly the default value.
|
||||||
*/
|
*/
|
||||||
@ -1659,6 +1670,7 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *elem,
|
|||||||
defaultValue = NULL;
|
defaultValue = NULL;
|
||||||
ctxt->valid = 0;
|
ctxt->valid = 0;
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check first that an attribute defined in the external subset wasn't
|
* Check first that an attribute defined in the external subset wasn't
|
||||||
@ -1713,12 +1725,14 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *elem,
|
|||||||
* Search the DTD for previous declarations of the ATTLIST
|
* Search the DTD for previous declarations of the ATTLIST
|
||||||
*/
|
*/
|
||||||
if (xmlHashAddEntry3(table, name, ns, elem, ret) < 0) {
|
if (xmlHashAddEntry3(table, name, ns, elem, ret) < 0) {
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/*
|
/*
|
||||||
* The attribute is already defined in this DTD.
|
* The attribute is already defined in this DTD.
|
||||||
*/
|
*/
|
||||||
VWARNING(ctxt->userData,
|
VWARNING(ctxt->userData,
|
||||||
"Attribute %s of element %s: already defined\n",
|
"Attribute %s of element %s: already defined\n",
|
||||||
name, elem);
|
name, elem);
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
xmlFreeAttribute(ret);
|
xmlFreeAttribute(ret);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
@ -1730,6 +1744,7 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *elem,
|
|||||||
elemDef = xmlGetDtdElementDesc2(dtd, elem, 1);
|
elemDef = xmlGetDtdElementDesc2(dtd, elem, 1);
|
||||||
if (elemDef != NULL) {
|
if (elemDef != NULL) {
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if ((type == XML_ATTRIBUTE_ID) &&
|
if ((type == XML_ATTRIBUTE_ID) &&
|
||||||
(xmlScanIDAttributeDecl(NULL, elemDef) != 0)) {
|
(xmlScanIDAttributeDecl(NULL, elemDef) != 0)) {
|
||||||
VERROR(ctxt->userData,
|
VERROR(ctxt->userData,
|
||||||
@ -1737,6 +1752,7 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *elem,
|
|||||||
elem, name);
|
elem, name);
|
||||||
ctxt->valid = 0;
|
ctxt->valid = 0;
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Insert namespace default def first they need to be
|
* Insert namespace default def first they need to be
|
||||||
@ -2040,8 +2056,10 @@ xmlAddNotationDecl(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED, xmlDtdPtr dtd,
|
|||||||
* Check the DTD for previous declarations of the ATTLIST
|
* Check the DTD for previous declarations of the ATTLIST
|
||||||
*/
|
*/
|
||||||
if (xmlHashAddEntry(table, name, ret)) {
|
if (xmlHashAddEntry(table, name, ret)) {
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"xmlAddNotationDecl: %s already defined\n", name);
|
"xmlAddNotationDecl: %s already defined\n", name);
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
xmlFreeNotation(ret);
|
xmlFreeNotation(ret);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
@ -2246,6 +2264,7 @@ xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value,
|
|||||||
ret->lineno = xmlGetLineNo(attr->parent);
|
ret->lineno = xmlGetLineNo(attr->parent);
|
||||||
|
|
||||||
if (xmlHashAddEntry(table, value, ret) < 0) {
|
if (xmlHashAddEntry(table, value, ret) < 0) {
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/*
|
/*
|
||||||
* The id is already defined in this DTD.
|
* The id is already defined in this DTD.
|
||||||
*/
|
*/
|
||||||
@ -2253,6 +2272,7 @@ xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value,
|
|||||||
VECTXT(ctxt, attr->parent);
|
VECTXT(ctxt, attr->parent);
|
||||||
VERROR(ctxt->userData, "ID %s already defined\n", value);
|
VERROR(ctxt->userData, "ID %s already defined\n", value);
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
xmlFreeID(ret);
|
xmlFreeID(ret);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
@ -2920,6 +2940,7 @@ xmlGetDtdNotationDesc(xmlDtdPtr dtd, const xmlChar *name) {
|
|||||||
return(xmlHashLookup(table, name));
|
return(xmlHashLookup(table, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/**
|
/**
|
||||||
* xmlValidateNotationUse:
|
* xmlValidateNotationUse:
|
||||||
* @ctxt: the validation context
|
* @ctxt: the validation context
|
||||||
@ -2949,6 +2970,7 @@ xmlValidateNotationUse(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
|||||||
}
|
}
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlIsMixedElement:
|
* xmlIsMixedElement:
|
||||||
@ -2988,6 +3010,7 @@ xmlIsMixedElement(xmlDocPtr doc, const xmlChar *name) {
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/**
|
/**
|
||||||
* xmlValidateNameValue:
|
* xmlValidateNameValue:
|
||||||
* @value: an Name value
|
* @value: an Name value
|
||||||
@ -6295,7 +6318,6 @@ xmlValidateDocument(xmlValidCtxtPtr ctxt, xmlDocPtr doc) {
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
* Routines for dynamic validation editing *
|
* Routines for dynamic validation editing *
|
||||||
@ -6473,3 +6495,5 @@ xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **list,
|
|||||||
|
|
||||||
return(nb_valid_elements);
|
return(nb_valid_elements);
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
|
||||||
|
@ -1597,6 +1597,7 @@ xmlTextReaderNext
|
|||||||
xmlTextReaderNodeType
|
xmlTextReaderNodeType
|
||||||
xmlTextReaderNormalization
|
xmlTextReaderNormalization
|
||||||
xmlTextReaderPrefix
|
xmlTextReaderPrefix
|
||||||
|
xmlTextReaderPreserve
|
||||||
xmlTextReaderQuoteChar
|
xmlTextReaderQuoteChar
|
||||||
xmlTextReaderRead
|
xmlTextReaderRead
|
||||||
xmlTextReaderReadAttributeValue
|
xmlTextReaderReadAttributeValue
|
||||||
|
2
xlink.c
2
xlink.c
@ -11,6 +11,7 @@
|
|||||||
#define IN_LIBXML
|
#define IN_LIBXML
|
||||||
#include "libxml.h"
|
#include "libxml.h"
|
||||||
|
|
||||||
|
#ifdef LIBXML_XPTR_ENABLED
|
||||||
#include <string.h> /* for memset() only */
|
#include <string.h> /* for memset() only */
|
||||||
#ifdef HAVE_CTYPE_H
|
#ifdef HAVE_CTYPE_H
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -177,3 +178,4 @@ xlinkIsLink (xmlDocPtr doc, xmlNodePtr node) {
|
|||||||
if (role != NULL) xmlFree(role);
|
if (role != NULL) xmlFree(role);
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_XPTR_ENABLED */
|
||||||
|
2
xmlIO.c
2
xmlIO.c
@ -1794,7 +1794,9 @@ xmlOutputBufferCreateFilename(const char *URI,
|
|||||||
void *context = NULL;
|
void *context = NULL;
|
||||||
char *unescaped;
|
char *unescaped;
|
||||||
|
|
||||||
|
#ifdef LIBXML_HTTP_ENABLED
|
||||||
int is_http_uri = 0; /* Can't change if HTTP disabled */
|
int is_http_uri = 0; /* Can't change if HTTP disabled */
|
||||||
|
#endif
|
||||||
|
|
||||||
if (xmlOutputCallbackInitialized == 0)
|
if (xmlOutputCallbackInitialized == 0)
|
||||||
xmlRegisterDefaultOutputCallbacks();
|
xmlRegisterDefaultOutputCallbacks();
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include <libxml/parser.h>
|
#include <libxml/parser.h>
|
||||||
#include <libxml/globals.h>
|
#include <libxml/globals.h>
|
||||||
|
|
||||||
|
#ifdef LIBXML_CATALOG_ENABLED
|
||||||
static int shell = 0;
|
static int shell = 0;
|
||||||
static int sgml = 0;
|
static int sgml = 0;
|
||||||
static int noout = 0;
|
static int noout = 0;
|
||||||
@ -39,7 +40,6 @@ static int convert = 0;
|
|||||||
static int verbose = 0;
|
static int verbose = 0;
|
||||||
static char *filename;
|
static char *filename;
|
||||||
|
|
||||||
#ifdef LIBXML_CATALOG_ENABLED
|
|
||||||
|
|
||||||
#ifndef XML_SGML_DEFAULT_CATALOG
|
#ifndef XML_SGML_DEFAULT_CATALOG
|
||||||
#define XML_SGML_DEFAULT_CATALOG "/etc/sgml/catalog"
|
#define XML_SGML_DEFAULT_CATALOG "/etc/sgml/catalog"
|
||||||
|
40
xmllint.c
40
xmllint.c
@ -104,10 +104,12 @@ static int recovery = 0;
|
|||||||
static int noent = 0;
|
static int noent = 0;
|
||||||
static int noout = 0;
|
static int noout = 0;
|
||||||
static int nowrap = 0;
|
static int nowrap = 0;
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
static int valid = 0;
|
static int valid = 0;
|
||||||
static int postvalid = 0;
|
static int postvalid = 0;
|
||||||
static char * dtdvalid = NULL;
|
static char * dtdvalid = NULL;
|
||||||
static char * dtdvalidfpi = NULL;
|
static char * dtdvalidfpi = NULL;
|
||||||
|
#endif
|
||||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||||
static char * relaxng = NULL;
|
static char * relaxng = NULL;
|
||||||
static xmlRelaxNGPtr relaxngschemas = NULL;
|
static xmlRelaxNGPtr relaxngschemas = NULL;
|
||||||
@ -117,7 +119,9 @@ static xmlSchemaPtr wxschemas = NULL;
|
|||||||
static int repeat = 0;
|
static int repeat = 0;
|
||||||
static int insert = 0;
|
static int insert = 0;
|
||||||
static int compress = 0;
|
static int compress = 0;
|
||||||
|
#ifdef LIBXML_HTML_ENABLED
|
||||||
static int html = 0;
|
static int html = 0;
|
||||||
|
#endif
|
||||||
static int htmlout = 0;
|
static int htmlout = 0;
|
||||||
static int push = 0;
|
static int push = 0;
|
||||||
#ifdef HAVE_SYS_MMAN_H
|
#ifdef HAVE_SYS_MMAN_H
|
||||||
@ -633,9 +637,11 @@ static void streamFile(char *filename) {
|
|||||||
reader = xmlNewTextReaderFilename(filename);
|
reader = xmlNewTextReaderFilename(filename);
|
||||||
|
|
||||||
if (reader != NULL) {
|
if (reader != NULL) {
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if (valid)
|
if (valid)
|
||||||
xmlTextReaderSetParserProp(reader, XML_PARSER_VALIDATE, 1);
|
xmlTextReaderSetParserProp(reader, XML_PARSER_VALIDATE, 1);
|
||||||
else
|
else
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
xmlTextReaderSetParserProp(reader, XML_PARSER_LOADDTD, 1);
|
xmlTextReaderSetParserProp(reader, XML_PARSER_LOADDTD, 1);
|
||||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||||
if (relaxng != NULL) {
|
if (relaxng != NULL) {
|
||||||
@ -670,13 +676,16 @@ static void streamFile(char *filename) {
|
|||||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||||
if ((valid) || (relaxng != NULL))
|
if ((valid) || (relaxng != NULL))
|
||||||
#else
|
#else
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if (valid)
|
if (valid)
|
||||||
#endif
|
|
||||||
endTimer("Parsing and validating");
|
endTimer("Parsing and validating");
|
||||||
else
|
else
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
#endif
|
||||||
endTimer("Parsing");
|
endTimer("Parsing");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (xmlTextReaderIsValid(reader) != 1) {
|
if (xmlTextReaderIsValid(reader) != 1) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@ -684,6 +693,7 @@ static void streamFile(char *filename) {
|
|||||||
progresult = 3;
|
progresult = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||||
if (relaxng != NULL) {
|
if (relaxng != NULL) {
|
||||||
if (xmlTextReaderIsValid(reader) != 1) {
|
if (xmlTextReaderIsValid(reader) != 1) {
|
||||||
@ -866,6 +876,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
|||||||
|
|
||||||
munmap((char *) base, info.st_size);
|
munmap((char *) base, info.st_size);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
} else if (valid) {
|
} else if (valid) {
|
||||||
xmlParserCtxtPtr ctxt = NULL;
|
xmlParserCtxtPtr ctxt = NULL;
|
||||||
|
|
||||||
@ -883,6 +894,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
|||||||
if (rectxt == NULL)
|
if (rectxt == NULL)
|
||||||
xmlFreeParserCtxt(ctxt);
|
xmlFreeParserCtxt(ctxt);
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
} else {
|
} else {
|
||||||
if (rectxt != NULL)
|
if (rectxt != NULL)
|
||||||
doc = xmlCtxtReadFile(rectxt, filename, NULL, options);
|
doc = xmlCtxtReadFile(rectxt, filename, NULL, options);
|
||||||
@ -945,6 +957,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
|||||||
xmlFreeDoc(tmp);
|
xmlFreeDoc(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if ((insert) && (!html)) {
|
if ((insert) && (!html)) {
|
||||||
const xmlChar* list[256];
|
const xmlChar* list[256];
|
||||||
int nb, i;
|
int nb, i;
|
||||||
@ -968,7 +981,9 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if (noout == 0) {
|
}else
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
|
if (noout == 0) {
|
||||||
/*
|
/*
|
||||||
* print it.
|
* print it.
|
||||||
*/
|
*/
|
||||||
@ -1048,6 +1063,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
/*
|
/*
|
||||||
* A posteriori validation test
|
* A posteriori validation test
|
||||||
*/
|
*/
|
||||||
@ -1128,8 +1144,10 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
|||||||
endTimer("Validating");
|
endTimer("Validating");
|
||||||
}
|
}
|
||||||
xmlFreeValidCtxt(cvp);
|
xmlFreeValidCtxt(cvp);
|
||||||
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||||
} else if (relaxngschemas != NULL) {
|
if (relaxngschemas != NULL) {
|
||||||
xmlRelaxNGValidCtxtPtr ctxt;
|
xmlRelaxNGValidCtxtPtr ctxt;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -1181,8 +1199,8 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
|||||||
if ((timing) && (!repeat)) {
|
if ((timing) && (!repeat)) {
|
||||||
endTimer("Validating");
|
endTimer("Validating");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef LIBXML_DEBUG_ENABLED
|
#ifdef LIBXML_DEBUG_ENABLED
|
||||||
if ((debugent) && (!html))
|
if ((debugent) && (!html))
|
||||||
@ -1210,6 +1228,9 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
|||||||
static void showVersion(const char *name) {
|
static void showVersion(const char *name) {
|
||||||
fprintf(stderr, "%s: using libxml version %s\n", name, xmlParserVersion);
|
fprintf(stderr, "%s: using libxml version %s\n", name, xmlParserVersion);
|
||||||
fprintf(stderr, " compiled with: ");
|
fprintf(stderr, " compiled with: ");
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
|
fprintf(stderr, "DTDValid ");
|
||||||
|
#endif
|
||||||
#ifdef LIBXML_FTP_ENABLED
|
#ifdef LIBXML_FTP_ENABLED
|
||||||
fprintf(stderr, "FTP ");
|
fprintf(stderr, "FTP ");
|
||||||
#endif
|
#endif
|
||||||
@ -1273,10 +1294,12 @@ static void usage(const char *name) {
|
|||||||
printf("\t--nonet : refuse to fetch DTDs or entities over network\n");
|
printf("\t--nonet : refuse to fetch DTDs or entities over network\n");
|
||||||
printf("\t--htmlout : output results as HTML\n");
|
printf("\t--htmlout : output results as HTML\n");
|
||||||
printf("\t--nowrap : do not put HTML doc wrapper\n");
|
printf("\t--nowrap : do not put HTML doc wrapper\n");
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
printf("\t--valid : validate the document in addition to std well-formed check\n");
|
printf("\t--valid : validate the document in addition to std well-formed check\n");
|
||||||
printf("\t--postvalid : do a posteriori validation, i.e after parsing\n");
|
printf("\t--postvalid : do a posteriori validation, i.e after parsing\n");
|
||||||
printf("\t--dtdvalid URL : do a posteriori validation against a given DTD\n");
|
printf("\t--dtdvalid URL : do a posteriori validation against a given DTD\n");
|
||||||
printf("\t--dtdvalidfpi FPI : same but name the DTD with a Public Identifier\n");
|
printf("\t--dtdvalidfpi FPI : same but name the DTD with a Public Identifier\n");
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
printf("\t--timing : print some timings\n");
|
printf("\t--timing : print some timings\n");
|
||||||
printf("\t--output file or -o file: save to a given file\n");
|
printf("\t--output file or -o file: save to a given file\n");
|
||||||
printf("\t--repeat : repeat 100 times, for timing or profiling\n");
|
printf("\t--repeat : repeat 100 times, for timing or profiling\n");
|
||||||
@ -1415,7 +1438,9 @@ main(int argc, char **argv) {
|
|||||||
loaddtd++;
|
loaddtd++;
|
||||||
dtdattrs++;
|
dtdattrs++;
|
||||||
options |= XML_PARSE_DTDATTR;
|
options |= XML_PARSE_DTDATTR;
|
||||||
} else if ((!strcmp(argv[i], "-valid")) ||
|
}
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
|
else if ((!strcmp(argv[i], "-valid")) ||
|
||||||
(!strcmp(argv[i], "--valid"))) {
|
(!strcmp(argv[i], "--valid"))) {
|
||||||
valid++;
|
valid++;
|
||||||
options |= XML_PARSE_DTDVALID;
|
options |= XML_PARSE_DTDVALID;
|
||||||
@ -1434,6 +1459,7 @@ main(int argc, char **argv) {
|
|||||||
dtdvalidfpi = argv[i];
|
dtdvalidfpi = argv[i];
|
||||||
loaddtd++;
|
loaddtd++;
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
else if ((!strcmp(argv[i], "-dropdtd")) ||
|
else if ((!strcmp(argv[i], "-dropdtd")) ||
|
||||||
(!strcmp(argv[i], "--dropdtd")))
|
(!strcmp(argv[i], "--dropdtd")))
|
||||||
dropdtd++;
|
dropdtd++;
|
||||||
@ -1596,7 +1622,9 @@ main(int argc, char **argv) {
|
|||||||
if (dtdattrs)
|
if (dtdattrs)
|
||||||
xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS;
|
xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS;
|
||||||
if (noent != 0) xmlSubstituteEntitiesDefault(1);
|
if (noent != 0) xmlSubstituteEntitiesDefault(1);
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if (valid != 0) xmlDoValidityCheckingDefaultValue = 1;
|
if (valid != 0) xmlDoValidityCheckingDefaultValue = 1;
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
if ((htmlout) && (!nowrap)) {
|
if ((htmlout) && (!nowrap)) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"\n");
|
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"\n");
|
||||||
@ -1669,6 +1697,7 @@ main(int argc, char **argv) {
|
|||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
#ifdef LIBXML_VALID_ENABLED
|
||||||
if ((!strcmp(argv[i], "-dtdvalid")) ||
|
if ((!strcmp(argv[i], "-dtdvalid")) ||
|
||||||
(!strcmp(argv[i], "--dtdvalid"))) {
|
(!strcmp(argv[i], "--dtdvalid"))) {
|
||||||
i++;
|
i++;
|
||||||
@ -1679,6 +1708,7 @@ main(int argc, char **argv) {
|
|||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
#endif /* LIBXML_VALID_ENABLED */
|
||||||
if ((!strcmp(argv[i], "-relaxng")) ||
|
if ((!strcmp(argv[i], "-relaxng")) ||
|
||||||
(!strcmp(argv[i], "--relaxng"))) {
|
(!strcmp(argv[i], "--relaxng"))) {
|
||||||
i++;
|
i++;
|
||||||
|
17
xmlmemory.c
17
xmlmemory.c
@ -29,6 +29,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MEM_LIST:
|
* MEM_LIST:
|
||||||
*
|
*
|
||||||
@ -43,6 +44,9 @@
|
|||||||
#include <libxml/globals.h>
|
#include <libxml/globals.h>
|
||||||
#include <libxml/xmlerror.h>
|
#include <libxml/xmlerror.h>
|
||||||
|
|
||||||
|
static int xmlMemInitialized = 0;
|
||||||
|
|
||||||
|
#ifdef DEBUG_MEMORY_LOCATION
|
||||||
void xmlMallocBreakpoint(void);
|
void xmlMallocBreakpoint(void);
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@ -108,7 +112,6 @@ static unsigned long debugMaxMemSize = 0;
|
|||||||
static int block=0;
|
static int block=0;
|
||||||
static int xmlMemStopAtBlock = 0;
|
static int xmlMemStopAtBlock = 0;
|
||||||
static void *xmlMemTraceBlockAt = NULL;
|
static void *xmlMemTraceBlockAt = NULL;
|
||||||
static int xmlMemInitialized = 0;
|
|
||||||
#ifdef MEM_LIST
|
#ifdef MEM_LIST
|
||||||
static MEMHDR *memlist = NULL;
|
static MEMHDR *memlist = NULL;
|
||||||
#endif
|
#endif
|
||||||
@ -712,6 +715,7 @@ static void debugmem_tag_error(void *p)
|
|||||||
|
|
||||||
static FILE *xmlMemoryDumpFile = NULL;
|
static FILE *xmlMemoryDumpFile = NULL;
|
||||||
|
|
||||||
|
#endif /* DEBUG_MEMORY_LOCATION */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlMemoryDump:
|
* xmlMemoryDump:
|
||||||
@ -722,6 +726,7 @@ static FILE *xmlMemoryDumpFile = NULL;
|
|||||||
void
|
void
|
||||||
xmlMemoryDump(void)
|
xmlMemoryDump(void)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_MEMORY_LOCATION
|
||||||
FILE *dump;
|
FILE *dump;
|
||||||
|
|
||||||
if (debugMaxMemSize == 0)
|
if (debugMaxMemSize == 0)
|
||||||
@ -734,6 +739,7 @@ xmlMemoryDump(void)
|
|||||||
xmlMemDisplay(xmlMemoryDumpFile);
|
xmlMemDisplay(xmlMemoryDumpFile);
|
||||||
|
|
||||||
if (dump != NULL) fclose(dump);
|
if (dump != NULL) fclose(dump);
|
||||||
|
#endif /* DEBUG_MEMORY_LOCATION */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -755,14 +761,15 @@ static int xmlInitMemoryDone = 0;
|
|||||||
int
|
int
|
||||||
xmlInitMemory(void)
|
xmlInitMemory(void)
|
||||||
{
|
{
|
||||||
int ret;
|
#ifdef DEBUG_MEMORY_LOCATION
|
||||||
|
|
||||||
#ifdef HAVE_STDLIB_H
|
#ifdef HAVE_STDLIB_H
|
||||||
char *breakpoint;
|
char *breakpoint;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (xmlInitMemoryDone) return(-1);
|
if (xmlInitMemoryDone) return(-1);
|
||||||
|
|
||||||
|
#ifdef DEBUG_MEMORY_LOCATION
|
||||||
#ifdef HAVE_STDLIB_H
|
#ifdef HAVE_STDLIB_H
|
||||||
breakpoint = getenv("XML_MEM_BREAKPOINT");
|
breakpoint = getenv("XML_MEM_BREAKPOINT");
|
||||||
if (breakpoint != NULL) {
|
if (breakpoint != NULL) {
|
||||||
@ -775,6 +782,7 @@ xmlInitMemory(void)
|
|||||||
sscanf(breakpoint, "%p", &xmlMemTraceBlockAt);
|
sscanf(breakpoint, "%p", &xmlMemTraceBlockAt);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* DEBUG_MEMORY_LOCATION */
|
||||||
|
|
||||||
#ifdef DEBUG_MEMORY
|
#ifdef DEBUG_MEMORY
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@ -783,8 +791,7 @@ xmlInitMemory(void)
|
|||||||
xmlMemInitialized = 1;
|
xmlMemInitialized = 1;
|
||||||
xmlInitMemoryDone = 1;
|
xmlInitMemoryDone = 1;
|
||||||
|
|
||||||
ret = 0;
|
return(0);
|
||||||
return(ret);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
4
xpath.c
4
xpath.c
@ -52,6 +52,7 @@
|
|||||||
#include <libxml/threads.h>
|
#include <libxml/threads.h>
|
||||||
#include <libxml/globals.h>
|
#include <libxml/globals.h>
|
||||||
|
|
||||||
|
#if defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XPATH_ENABLED)
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
* Floating point stuff *
|
* Floating point stuff *
|
||||||
@ -119,6 +120,8 @@ xmlXPathIsInf(double val) {
|
|||||||
return(trio_isinf(val));
|
return(trio_isinf(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* SCHEMAS or XPATH */
|
||||||
|
#ifdef LIBXML_XPATH_ENABLED
|
||||||
/**
|
/**
|
||||||
* xmlXPathGetSign:
|
* xmlXPathGetSign:
|
||||||
* @val: a double value
|
* @val: a double value
|
||||||
@ -135,7 +138,6 @@ xmlXPathGetSign(double val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef LIBXML_XPATH_ENABLED
|
|
||||||
/*
|
/*
|
||||||
* TODO: when compatibility allows remove all "fake node libxslt" strings
|
* TODO: when compatibility allows remove all "fake node libxslt" strings
|
||||||
* the test should just be name[0] = ' '
|
* the test should just be name[0] = ' '
|
||||||
|
Reference in New Issue
Block a user