mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
Fixed #6766 and satrted working on white space handling, Daniel
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
Thu Mar 2 02:26:13 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
|
||||||
|
|
||||||
|
* parser.c: tried to remove the <a> </a> generating <a/>
|
||||||
|
this is hard. Left a flag for that purpose. Fixed bug #6766
|
||||||
|
* configure.in: prepared 1.8.7 not released, due to previous
|
||||||
|
problem
|
||||||
|
|
||||||
Thu Mar 2 03:03:50 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
|
Thu Mar 2 03:03:50 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
|
||||||
|
|
||||||
* doc/xml.html : applied second patch from Paul DuBois
|
* doc/xml.html : applied second patch from Paul DuBois
|
||||||
|
@ -256,8 +256,6 @@ confexec_DATA = xmlConf.sh
|
|||||||
|
|
||||||
CLEANFILES=xmlConf.sh
|
CLEANFILES=xmlConf.sh
|
||||||
|
|
||||||
EXTRA_DIST = xmlConf.sh.in
|
|
||||||
|
|
||||||
confexecdir=$(libdir)
|
confexecdir=$(libdir)
|
||||||
confexec_DATA = xmlConf.sh
|
confexec_DATA = xmlConf.sh
|
||||||
EXTRA_DIST = xmlConf.sh.in libxml.spec.in libxml.spec \
|
EXTRA_DIST = xmlConf.sh.in libxml.spec.in libxml.spec \
|
||||||
|
@ -5,7 +5,7 @@ AM_CONFIG_HEADER(config.h)
|
|||||||
|
|
||||||
LIBXML_MAJOR_VERSION=1
|
LIBXML_MAJOR_VERSION=1
|
||||||
LIBXML_MINOR_VERSION=8
|
LIBXML_MINOR_VERSION=8
|
||||||
LIBXML_MICRO_VERSION=6
|
LIBXML_MICRO_VERSION=7
|
||||||
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION
|
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION
|
||||||
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
|
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
|
||||||
|
|
||||||
|
@ -159,6 +159,7 @@ struct _xmlParserCtxt {
|
|||||||
|
|
||||||
long nbChars; /* number of xmlChar processed */
|
long nbChars; /* number of xmlChar processed */
|
||||||
long checkIndex; /* used by progressive parsing lookup */
|
long checkIndex; /* used by progressive parsing lookup */
|
||||||
|
int keepBlanks; /* ugly but ... */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
29
parser.c
29
parser.c
@ -263,6 +263,7 @@ xmlParserInputShrink(xmlParserInputPtr in) {
|
|||||||
|
|
||||||
int xmlSubstituteEntitiesDefaultValue = 0;
|
int xmlSubstituteEntitiesDefaultValue = 0;
|
||||||
int xmlDoValidityCheckingDefaultValue = 0;
|
int xmlDoValidityCheckingDefaultValue = 0;
|
||||||
|
int xmlKeepBlanksDefaultValue = 0;
|
||||||
xmlEntityPtr xmlParseStringEntityRef(xmlParserCtxtPtr ctxt,
|
xmlEntityPtr xmlParseStringEntityRef(xmlParserCtxtPtr ctxt,
|
||||||
const xmlChar ** str);
|
const xmlChar ** str);
|
||||||
|
|
||||||
@ -684,6 +685,7 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
|
|||||||
ctxt->wellFormed = 1;
|
ctxt->wellFormed = 1;
|
||||||
ctxt->valid = 1;
|
ctxt->valid = 1;
|
||||||
ctxt->validate = xmlDoValidityCheckingDefaultValue;
|
ctxt->validate = xmlDoValidityCheckingDefaultValue;
|
||||||
|
ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
|
||||||
ctxt->vctxt.userData = ctxt;
|
ctxt->vctxt.userData = ctxt;
|
||||||
if (ctxt->validate) {
|
if (ctxt->validate) {
|
||||||
ctxt->vctxt.error = xmlParserValidityError;
|
ctxt->vctxt.error = xmlParserValidityError;
|
||||||
@ -2077,27 +2079,37 @@ static int areBlanks(xmlParserCtxtPtr ctxt, const xmlChar *str, int len) {
|
|||||||
int i, ret;
|
int i, ret;
|
||||||
xmlNodePtr lastChild;
|
xmlNodePtr lastChild;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check that the string is made of blanks
|
||||||
|
*/
|
||||||
for (i = 0;i < len;i++)
|
for (i = 0;i < len;i++)
|
||||||
if (!(IS_BLANK(str[i]))) return(0);
|
if (!(IS_BLANK(str[i]))) return(0);
|
||||||
|
|
||||||
if (CUR != '<') return(0);
|
/*
|
||||||
if (ctxt->node == NULL) return(0);
|
* Look if the element is mixed content in the Dtd if available
|
||||||
|
*/
|
||||||
if (ctxt->myDoc != NULL) {
|
if (ctxt->myDoc != NULL) {
|
||||||
ret = xmlIsMixedElement(ctxt->myDoc, ctxt->node->name);
|
ret = xmlIsMixedElement(ctxt->myDoc, ctxt->node->name);
|
||||||
if (ret == 0) return(1);
|
if (ret == 0) return(1);
|
||||||
if (ret == 1) return(0);
|
if (ret == 1) return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* heuristic
|
* Do we allow an heuristic on white space
|
||||||
*/
|
*/
|
||||||
|
if (ctxt->keepBlanks)
|
||||||
|
return(0);
|
||||||
|
if (CUR != '<') return(0);
|
||||||
|
if (ctxt->node == NULL) return(0);
|
||||||
|
|
||||||
lastChild = xmlGetLastChild(ctxt->node);
|
lastChild = xmlGetLastChild(ctxt->node);
|
||||||
if (lastChild == NULL) {
|
if (lastChild == NULL) {
|
||||||
if (ctxt->node->content != NULL) return(0);
|
if (ctxt->node->content != NULL) return(0);
|
||||||
} else if (xmlNodeIsText(lastChild))
|
} else if (xmlNodeIsText(lastChild))
|
||||||
return(0);
|
return(0);
|
||||||
else if ((ctxt->node->childs != NULL) &&
|
else if ((ctxt->node->childs != NULL) &&
|
||||||
(xmlNodeIsText(ctxt->node->childs)))
|
(xmlNodeIsText(ctxt->node->childs)))
|
||||||
return(0);
|
return(0);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8319,7 +8331,8 @@ xmlCreateMemoryParserCtxt(char *buffer, int size) {
|
|||||||
xmlParserInputPtr input;
|
xmlParserInputPtr input;
|
||||||
xmlCharEncoding enc;
|
xmlCharEncoding enc;
|
||||||
|
|
||||||
buffer[size - 1] = '\0';
|
if (buffer[size] != '\0')
|
||||||
|
buffer[size] = '\0';
|
||||||
|
|
||||||
ctxt = xmlNewParserCtxt();
|
ctxt = xmlNewParserCtxt();
|
||||||
if (ctxt == NULL) {
|
if (ctxt == NULL) {
|
||||||
|
1
parser.h
1
parser.h
@ -159,6 +159,7 @@ struct _xmlParserCtxt {
|
|||||||
|
|
||||||
long nbChars; /* number of xmlChar processed */
|
long nbChars; /* number of xmlChar processed */
|
||||||
long checkIndex; /* used by progressive parsing lookup */
|
long checkIndex; /* used by progressive parsing lookup */
|
||||||
|
int keepBlanks; /* ugly but ... */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user