summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2001-05-03 08:27:20 +0000
committerDaniel Veillard <veillard@src.gnome.org>2001-05-03 08:27:20 +0000
commita2bc368bc9bbca85ad63dca60984ae79ddc4f8c8 (patch)
treef415249e83bf3a4d9a4dd312f3781f492ed96e62
parent2a0d2e6b14a336b611c99563e192cda0b9af619e (diff)
downloadlibxml2-a2bc368bc9bbca85ad63dca60984ae79ddc4f8c8.tar.gz
- HTMLparser.c: trying to fix the problem reported by Jonas Borgström
- results/HTML/ : a few changes in the output of the HTML tests as a result. - configure.in: tying to fix -liconv where needed Daniel
-rw-r--r--ChangeLog7
-rw-r--r--HTMLparser.c19
-rw-r--r--aclocal.m440
-rw-r--r--configure.in3
-rw-r--r--result/HTML/doc3.htm.err6
-rw-r--r--result/HTML/doc3.htm.sax6
-rw-r--r--result/HTML/wired.html.err6
-rw-r--r--result/HTML/wired.html.sax12
8 files changed, 55 insertions, 44 deletions
diff --git a/ChangeLog b/ChangeLog
index e1859f8a..a73a6395 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu May 3 10:25:19 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+ * HTMLparser.c: trying to fix the problem reported by Jonas Borgström
+ * results/HTML/ : a few changes in the output of the HTML tests as
+ a result.
+ * configure.in: tying to fix -liconv where needed
+
Wed May 2 19:10:26 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* Makefile.am: fixed a stupid error
diff --git a/HTMLparser.c b/HTMLparser.c
index ace49d9f..13db1f0c 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -564,6 +564,16 @@ static const char *htmlScriptAttributes[] = {
"onselect"
};
+/*
+ * end tags that imply the end of the inside elements
+ */
+const char *htmlEndClose[] = {
+"head",
+"body",
+"html",
+NULL
+};
+
static const char** htmlStartCloseIndex[100];
static int htmlStartCloseIndexinitialized = 0;
@@ -664,7 +674,7 @@ static void
htmlAutoCloseOnClose(htmlParserCtxtPtr ctxt, const xmlChar *newtag) {
htmlElemDescPtr info;
xmlChar *oldname;
- int i;
+ int i, endCloses = 0;
#ifdef DEBUG
xmlGenericError(xmlGenericErrorContext,"Close of %s stack: %d elements\n", newtag, ctxt->nameNr);
@@ -676,6 +686,11 @@ htmlAutoCloseOnClose(htmlParserCtxtPtr ctxt, const xmlChar *newtag) {
if (xmlStrEqual(newtag, ctxt->nameTab[i])) break;
}
if (i < 0) return;
+ for (i = 0; (htmlEndClose[i] != NULL);i++)
+ if (xmlStrEqual(newtag, (const xmlChar *) htmlEndClose[i])) {
+ endCloses = 1;
+ break;
+ }
while (!xmlStrEqual(newtag, ctxt->name)) {
info = htmlTagLookup(ctxt->name);
@@ -692,7 +707,7 @@ htmlAutoCloseOnClose(htmlParserCtxtPtr ctxt, const xmlChar *newtag) {
"Opening and ending tag mismatch: %s and %s\n",
newtag, ctxt->name);
ctxt->wellFormed = 0;
- } else {
+ } else if (endCloses == 0) {
return;
}
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
diff --git a/aclocal.m4 b/aclocal.m4
index 869e5fcc..e3726759 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -620,31 +620,35 @@ esac
])
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl convenience library, adds --enable-ltdl-convenience to
-# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
-# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
-# to be `${top_builddir}/libltdl'. Make sure you start DIR with
-# '${top_builddir}/' (note the single quotes!) if your package is not
-# flat, and, if you're not using automake, define top_builddir as
-# appropriate in the Makefiles.
+# the libltdl convenience library and INCLTDL to the include flags for
+# the libltdl header and adds --enable-ltdl-convenience to the
+# configure arguments. Note that LIBLTDL and INCLTDL are not
+# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
+# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
+# with '${top_builddir}/' and INCLTDL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!). If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
case "$enable_ltdl_convenience" in
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
"") enable_ltdl_convenience=yes
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
esac
- LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
- INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+ INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
])
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl installable library, and adds --enable-ltdl-install to
-# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
-# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
-# to be `${top_builddir}/libltdl'. Make sure you start DIR with
-# '${top_builddir}/' (note the single quotes!) if your package is not
-# flat, and, if you're not using automake, define top_builddir as
-# appropriate in the Makefiles.
+# the libltdl installable library and INCLTDL to the include flags for
+# the libltdl header and adds --enable-ltdl-install to the configure
+# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
+# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
+# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
+# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
+# with '${top_srcdir}/' (note the single quotes!). If your package is
+# not flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_CHECK_LIB(ltdl, main,
@@ -657,8 +661,8 @@ AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
])
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
- LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
- INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+ INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
else
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
diff --git a/configure.in b/configure.in
index 416a3ec5..bc90bbc3 100644
--- a/configure.in
+++ b/configure.in
@@ -359,7 +359,8 @@ if test "$with_iconv" = "no" ; then
WITH_ICONV=0
else
AC_CHECK_HEADER(iconv.h,
- AC_CHECK_FUNC(iconv, , AC_CHECK_LIB(iconv, iconv)))
+ AC_CHECK_FUNC(iconv, ,
+ AC_CHECK_LIB(iconv, iconv, XML_LIBS="$XML_LIBS -liconv")))
if test "$have_iconv" != "" ; then
echo Iconv support not found
WITH_ICONV=0
diff --git a/result/HTML/doc3.htm.err b/result/HTML/doc3.htm.err
index dc31663b..86783eaa 100644
--- a/result/HTML/doc3.htm.err
+++ b/result/HTML/doc3.htm.err
@@ -91,9 +91,3 @@ HEIGHT="70">&nbsp;</TD> </TR></TABLE>
./test/HTML/doc3.htm:844: error: Opening and ending tag mismatch: div and tbody
,arial">Site design by Tim Brinkley</FONT> </TD> </TR> --></TBODY></TABLE></DI
^
-./test/HTML/doc3.htm:846: error: Opening and ending tag mismatch: body and tbody
-</BODY></HTML>
- ^
-./test/HTML/doc3.htm:846: error: Opening and ending tag mismatch: html and tbody
-</BODY></HTML>
- ^
diff --git a/result/HTML/doc3.htm.sax b/result/HTML/doc3.htm.sax
index 1fe57db7..7c356614 100644
--- a/result/HTML/doc3.htm.sax
+++ b/result/HTML/doc3.htm.sax
@@ -2872,13 +2872,11 @@ SAX.cdata( window.open=NS_ActualOpen; , 28)
SAX.endElement(script)
SAX.characters(
, 2)
-SAX.error: Opening and ending tag mismatch: body and tbody
-SAX.error: Opening and ending tag mismatch: html and tbody
-SAX.ignorableWhitespace(
-, 2)
SAX.endElement(tbody)
SAX.endElement(table)
SAX.endElement(div)
SAX.endElement(body)
SAX.endElement(html)
+SAX.ignorableWhitespace(
+, 2)
SAX.endDocument()
diff --git a/result/HTML/wired.html.err b/result/HTML/wired.html.err
index a21b2ce1..ecf58e8f 100644
--- a/result/HTML/wired.html.err
+++ b/result/HTML/wired.html.err
@@ -259,9 +259,3 @@ com&BANNER=Sprint" style="text-decoration:none"><font color="#000000">Sprint</a
./test/HTML/wired.html:430: error: htmlParseEntityRef: expecting ';'
href="http://www.lycos.com/news/flash/hitlerbunker.html?v=wn1015&lpv=1">Lycos</
^
-./test/HTML/wired.html:512: error: Opening and ending tag mismatch: body and td
-</body>
- ^
-./test/HTML/wired.html:513: error: Opening and ending tag mismatch: html and td
-</html>
- ^
diff --git a/result/HTML/wired.html.sax b/result/HTML/wired.html.sax
index d9e90eff..b90ae2db 100644
--- a/result/HTML/wired.html.sax
+++ b/result/HTML/wired.html.sax
@@ -2836,13 +2836,6 @@ SAX.startElement(br)
SAX.endElement(br)
SAX.characters(
, 1)
-SAX.error: Opening and ending tag mismatch: body and td
-SAX.characters(
-, 1)
-SAX.error: Opening and ending tag mismatch: html and td
-SAX.ignorableWhitespace(
-
-, 2)
SAX.endElement(td)
SAX.endElement(tr)
SAX.endElement(table)
@@ -2850,5 +2843,10 @@ SAX.endElement(td)
SAX.endElement(tr)
SAX.endElement(table)
SAX.endElement(body)
+SAX.ignorableWhitespace(
+, 1)
SAX.endElement(html)
+SAX.ignorableWhitespace(
+
+, 2)
SAX.endDocument()