HTML parsing, output is now correct, added HTMLtests target and testcases, Daniel
diff --git a/ChangeLog b/ChangeLog
index 37d8414..85adc27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Jul 7 09:28:43 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
+
+ * HTMLparser.[ch], HTMLtree.[ch]: more work for HTML parsing and
+ output.
+ * Makefile.am, test/HTML/*, result/HTML/*: added HTMLtests targetestHTMLt
+
Wed Jul 7 00:25:42 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* parser.h : Oops removed the binary compatibility problem
diff --git a/HTMLparser.c b/HTMLparser.c
index 119daa2..5259f6e 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -34,7 +34,7 @@
#include "valid.h"
#include "parserInternals.h"
-#define DEBUG */
+/* #define DEBUG */
/************************************************************************
* *
@@ -351,7 +351,6 @@
htmlElemDescPtr
htmlTagLookup(const CHAR *tag) {
int i = 0;
- int cnt;
for (i = 0; i < (sizeof(html40ElementTable) /
sizeof(html40ElementTable[0]));i++) {
@@ -408,7 +407,6 @@
*/
void
htmlAutoClose(htmlParserCtxtPtr ctxt, const CHAR *new) {
- const CHAR *old;
while ((ctxt->node != NULL) &&
(htmlCheckAutoClose(new, ctxt->node->name))) {
@@ -1933,7 +1931,7 @@
atts = (const CHAR **) malloc(maxatts * sizeof(CHAR *));
if (atts == NULL) {
fprintf(stderr, "malloc of %ld byte failed\n",
- maxatts * sizeof(CHAR *));
+ maxatts * (long)sizeof(CHAR *));
return(NULL);
}
} else if (nbatts + 2 < maxatts) {
@@ -1941,7 +1939,7 @@
atts = (const CHAR **) realloc(atts, maxatts * sizeof(CHAR *));
if (atts == NULL) {
fprintf(stderr, "realloc of %ld byte failed\n",
- maxatts * sizeof(CHAR *));
+ maxatts * (long)sizeof(CHAR *));
return(NULL);
}
}
diff --git a/HTMLparser.h b/HTMLparser.h
index 23ff9af..749566c 100644
--- a/HTMLparser.h
+++ b/HTMLparser.h
@@ -48,8 +48,10 @@
/*
* There is only few public functions.
*/
-htmlEntityDescPtr
-htmlParseEntityRef(htmlParserCtxtPtr ctxt, CHAR **str);
+htmlElemDescPtr htmlTagLookup(const CHAR *tag);
+htmlEntityDescPtr htmlEntityLookup(const CHAR *name);
+
+htmlEntityDescPtr htmlParseEntityRef(htmlParserCtxtPtr ctxt, CHAR **str);
int htmlParseCharRef(htmlParserCtxtPtr ctxt);
void htmlParseElement(htmlParserCtxtPtr ctxt);
diff --git a/HTMLtree.c b/HTMLtree.c
index a8e91da..0d4b45f 100644
--- a/HTMLtree.c
+++ b/HTMLtree.c
@@ -12,14 +12,11 @@
#include <stdlib.h>
#include <string.h> /* for memset() only ! */
-#include "tree.h"
+#include "HTMLparser.h"
+#include "HTMLtree.h"
#include "entities.h"
#include "valid.h"
-#define HTML_TEXT_NODE XML_TEXT_NODE
-#define HTML_ENTITY_REF_NODE XML_ENTITY_REF_NODE
-#define HTML_COMMENT_NODE XML_COMMENT_NODE
-
/**
* htmlDtdDump:
* @buf: the HTML buffer output
@@ -46,23 +43,6 @@
xmlBufferWriteChar(buf, " SYSTEM ");
xmlBufferWriteQuotedString(buf, cur->SystemID);
}
- if ((cur->entities == NULL) && (cur->elements == NULL) &&
- (cur->attributes == NULL) && (cur->notations == NULL)) {
- xmlBufferWriteChar(buf, ">\n");
- return;
- }
- xmlBufferWriteChar(buf, " [\n");
- if (cur->entities != NULL)
- xmlDumpEntitiesTable(buf, (xmlEntitiesTablePtr) cur->entities);
- if (cur->notations != NULL)
- xmlDumpNotationTable(buf, (xmlNotationTablePtr) cur->notations);
- if (cur->elements != NULL)
- xmlDumpElementTable(buf, (xmlElementTablePtr) cur->elements);
- if (cur->attributes != NULL)
- xmlDumpAttributeTable(buf, (xmlAttributeTablePtr) cur->attributes);
- xmlBufferWriteChar(buf, "]");
-
- /* TODO !!! a lot more things to dump ... */
xmlBufferWriteChar(buf, ">\n");
}
@@ -116,30 +96,23 @@
static void
-htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level);
+htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur);
/**
* htmlNodeListDump:
* @buf: the HTML buffer output
* @doc: the document
* @cur: the first node
- * @level: the imbrication level for indenting
*
* Dump an HTML node list, recursive behaviour,children are printed too.
*/
static void
-htmlNodeListDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level) {
- int i;
-
+htmlNodeListDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
if (cur == NULL) {
fprintf(stderr, "htmlNodeListDump : node == NULL\n");
return;
}
while (cur != NULL) {
- if ((cur->type != HTML_TEXT_NODE) &&
- (cur->type != HTML_ENTITY_REF_NODE)) {
- xmlBufferWriteChar(buf, "\n");
- }
- htmlNodeDump(buf, doc, cur, level);
+ htmlNodeDump(buf, doc, cur);
cur = cur->next;
}
}
@@ -149,22 +122,26 @@
* @buf: the HTML buffer output
* @doc: the document
* @cur: the current node
- * @level: the imbrication level for indenting
*
* Dump an HTML node, recursive behaviour,children are printed too.
*/
static void
-htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level) {
+htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
int i;
+ htmlElemDescPtr info;
if (cur == NULL) {
fprintf(stderr, "htmlNodeDump : node == NULL\n");
return;
}
+ /*
+ * Special cases.
+ */
if (cur->type == HTML_TEXT_NODE) {
if (cur->content != NULL) {
CHAR *buffer;
+ /* uses the HTML encoding routine !!!!!!!!!! */
buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
if (buffer != NULL) {
xmlBufferWriteCHAR(buf, buffer);
@@ -188,20 +165,38 @@
return;
}
- xmlBufferWriteChar(buf, "<");
- if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
- xmlBufferWriteCHAR(buf, cur->ns->prefix);
- xmlBufferWriteChar(buf, ":");
- }
+ /*
+ * Get specific HTmL info for taht node.
+ */
+ info = htmlTagLookup(cur->name);
+ xmlBufferWriteChar(buf, "<");
xmlBufferWriteCHAR(buf, cur->name);
- if (cur->nsDef)
- xmlNsListDump(buf, cur->nsDef);
if (cur->properties != NULL)
htmlAttrListDump(buf, doc, cur->properties);
+ if (info->empty) {
+ xmlBufferWriteChar(buf, ">");
+ if (cur->next != NULL) {
+ if ((cur->next->type != HTML_TEXT_NODE) &&
+ (cur->next->type != HTML_ENTITY_REF_NODE))
+ xmlBufferWriteChar(buf, "\n");
+ }
+ return;
+ }
if ((cur->content == NULL) && (cur->childs == NULL)) {
- xmlBufferWriteChar(buf, "/>\n");
+ if (info->endTag != 0)
+ xmlBufferWriteChar(buf, ">");
+ else {
+ xmlBufferWriteChar(buf, "></");
+ xmlBufferWriteCHAR(buf, cur->name);
+ xmlBufferWriteChar(buf, ">");
+ }
+ if (cur->next != NULL) {
+ if ((cur->next->type != HTML_TEXT_NODE) &&
+ (cur->next->type != HTML_ENTITY_REF_NODE))
+ xmlBufferWriteChar(buf, "\n");
+ }
return;
}
xmlBufferWriteChar(buf, ">");
@@ -215,16 +210,22 @@
}
}
if (cur->childs != NULL) {
- htmlNodeListDump(buf, doc, cur->childs, level + 1);
+ if ((cur->childs->type != HTML_TEXT_NODE) &&
+ (cur->childs->type != HTML_ENTITY_REF_NODE))
+ xmlBufferWriteChar(buf, "\n");
+ htmlNodeListDump(buf, doc, cur->childs);
+ if ((cur->last->type != HTML_TEXT_NODE) &&
+ (cur->last->type != HTML_ENTITY_REF_NODE))
+ xmlBufferWriteChar(buf, "\n");
}
xmlBufferWriteChar(buf, "</");
- if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
- xmlBufferWriteCHAR(buf, cur->ns->prefix);
- xmlBufferWriteChar(buf, ":");
- }
-
xmlBufferWriteCHAR(buf, cur->name);
- xmlBufferWriteChar(buf, ">\n");
+ xmlBufferWriteChar(buf, ">");
+ if (cur->next != NULL) {
+ if ((cur->next->type != HTML_TEXT_NODE) &&
+ (cur->next->type != HTML_ENTITY_REF_NODE))
+ xmlBufferWriteChar(buf, "\n");
+ }
}
/**
@@ -236,29 +237,12 @@
*/
static void
htmlDocContentDump(xmlBufferPtr buf, xmlDocPtr cur) {
- xmlBufferWriteChar(buf, "<?xml version=");
- if (cur->version != NULL)
- xmlBufferWriteQuotedString(buf, cur->version);
- else
- xmlBufferWriteChar(buf, "\"1.0\"");
- if (cur->encoding != NULL) {
- xmlBufferWriteChar(buf, " encoding=");
- xmlBufferWriteQuotedString(buf, cur->encoding);
- }
- switch (cur->standalone) {
- case 0:
- xmlBufferWriteChar(buf, " standalone=\"no\"");
- break;
- case 1:
- xmlBufferWriteChar(buf, " standalone=\"yes\"");
- break;
- }
- xmlBufferWriteChar(buf, "?>\n");
if (cur->intSubset != NULL)
htmlDtdDump(buf, cur);
if (cur->root != NULL) {
- htmlNodeDump(buf, cur, cur->root, 0);
+ htmlNodeDump(buf, cur, cur->root);
}
+ xmlBufferWriteChar(buf, "\n");
}
/**
diff --git a/HTMLtree.h b/HTMLtree.h
new file mode 100644
index 0000000..09206db
--- /dev/null
+++ b/HTMLtree.h
@@ -0,0 +1,34 @@
+/*
+ * tree.h : describes the structures found in an tree resulting
+ * from an XML parsing.
+ *
+ * See Copyright for the status of this software.
+ *
+ * Daniel.Veillard@w3.org
+ */
+
+#ifndef __HTML_TREE_H__
+#define __HTML_TREE_H__
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+#include "tree.h"
+
+#define HTML_TEXT_NODE XML_TEXT_NODE
+#define HTML_ENTITY_REF_NODE XML_ENTITY_REF_NODE
+#define HTML_COMMENT_NODE XML_COMMENT_NODE
+
+void htmlDocDumpMemory(xmlDocPtr cur, CHAR**mem, int *size);
+void htmlDocDump(FILE *f, xmlDocPtr cur);
+int htmlSaveFile(const char *filename, xmlDocPtr cur);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __HTML_TREE_H__ */
+
diff --git a/Makefile.am b/Makefile.am
index e06d464..0f239c3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -61,7 +61,24 @@
testall : tests SVGtests SAXtests
-tests : tester
+tests: HTMLtests XMLtests
+HTMLtests : testHTML
+ @(DIR=`pwd`; cd $(srcdir) ; \
+ for i in test/HTML/* ; do \
+ if [ ! -d $$i ] ; then \
+ if [ ! -f result/HTML/`basename $$i` ] ; then \
+ echo New test file `basename $$i` ; \
+ $$DIR/testHTML $$i > result/HTML/`basename $$i` ; \
+ else \
+ echo Testing `basename $$i` ; \
+ $$DIR/testHTML $$i > result.`basename $$i` ; \
+ diff result/HTML/`basename $$i` result.`basename $$i` ; \
+ $$DIR/testHTML result.`basename $$i` > result2.`basename $$i` ; \
+ diff result.`basename $$i` result2.`basename $$i` ; \
+ rm result.`basename $$i` result2.`basename $$i` ; \
+ fi ; fi ; done)
+
+XMLtests : tester
@(DIR=`pwd`; cd $(srcdir) ; \
for i in test/* ; do \
if [ ! -d $$i ] ; then \
diff --git a/include/libxml/HTMLparser.h b/include/libxml/HTMLparser.h
index 23ff9af..749566c 100644
--- a/include/libxml/HTMLparser.h
+++ b/include/libxml/HTMLparser.h
@@ -48,8 +48,10 @@
/*
* There is only few public functions.
*/
-htmlEntityDescPtr
-htmlParseEntityRef(htmlParserCtxtPtr ctxt, CHAR **str);
+htmlElemDescPtr htmlTagLookup(const CHAR *tag);
+htmlEntityDescPtr htmlEntityLookup(const CHAR *name);
+
+htmlEntityDescPtr htmlParseEntityRef(htmlParserCtxtPtr ctxt, CHAR **str);
int htmlParseCharRef(htmlParserCtxtPtr ctxt);
void htmlParseElement(htmlParserCtxtPtr ctxt);
diff --git a/include/libxml/HTMLtree.h b/include/libxml/HTMLtree.h
new file mode 100644
index 0000000..09206db
--- /dev/null
+++ b/include/libxml/HTMLtree.h
@@ -0,0 +1,34 @@
+/*
+ * tree.h : describes the structures found in an tree resulting
+ * from an XML parsing.
+ *
+ * See Copyright for the status of this software.
+ *
+ * Daniel.Veillard@w3.org
+ */
+
+#ifndef __HTML_TREE_H__
+#define __HTML_TREE_H__
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+#include "tree.h"
+
+#define HTML_TEXT_NODE XML_TEXT_NODE
+#define HTML_ENTITY_REF_NODE XML_ENTITY_REF_NODE
+#define HTML_COMMENT_NODE XML_COMMENT_NODE
+
+void htmlDocDumpMemory(xmlDocPtr cur, CHAR**mem, int *size);
+void htmlDocDump(FILE *f, xmlDocPtr cur);
+int htmlSaveFile(const char *filename, xmlDocPtr cur);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __HTML_TREE_H__ */
+
diff --git a/result/HTML/Down.html b/result/HTML/Down.html
new file mode 100644
index 0000000..5504cd4
--- /dev/null
+++ b/result/HTML/Down.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<HTML>
+<HEAD>
+<TITLE>This service is temporary down</TITLE>
+</HEAD>
+<BODY bgcolor="#FFFFFF">
+<H1 align="center">Sorry, this service is temporary down</H1>
+We are doing our best to get it back on-line,
+
+<P>The W3C system administrators</P>
+</BODY>
+</HTML>
diff --git a/result/HTML/test2.html b/result/HTML/test2.html
new file mode 100644
index 0000000..c462702
--- /dev/null
+++ b/result/HTML/test2.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<HTML>
+<HEAD>
+<TITLE>Linux Today</TITLE>
+</HEAD>
+<BODY bgcolor="White" link="Blue" text="Black" VLINK="Black" ALINK="Red">
+<CENTER>
+<TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0">
+<TR BGCOLOR="#FFFFFF">
+<TD HEIGHT="90">
+<A href="http://linuxtoday.com/cgi-bin/click.pl?adnum=49">
+<IMG src="/pics/door_linux.gif" border="0" width="468" height="60" alt="Atipa Linux solutions. Your reliable cluster, server, and workstation solution. Win a Free Celeron Linux Workstation!">
+</A>
+</TD>
+<TD>
+<IMG SRC="/pics/lt.gif" VSPACE="5" alt="Linux Today Logo">
+<BR>
+<FONT size="-1">
+<A href="http://linux.com">linux.com</A> partner</FONT>
+<P>
+</TD>
+</TR>
+</TABLE>
+<FONT size="2" face="Helvetica">
+[ <A href="http://linuxtoday.com/">headlines</A> |
+<A href="http://features.linuxtoday.com/">features</A> |
+<A href="http://commercial.linuxtoday.com/">commercial</A> |
+<A href="http://security.linuxtoday.com/">security</A> |
+<A href="http://jobs.linuxtoday.com/">jobs</A> |
+<A href="http://linuxtoday.com/volt/">volt</A> |
+<A href="http://linuxtoday.com/contrib.pl">contribute/submit</A> |
+<A href="http://linuxtoday.com/advertise/">advertise</A> |
+<A href="http://linuxtoday.com/search.html">search</A> |
+<A href="http://linuxtoday.com/digests/">site digests</A> |
+<A href="http://linuxtoday.com/mail-lists">mailing lists</A> |
+<A href="http://linuxtoday.com/about/">about us</A> |
+<A href="http://linuxtoday.com/linkus.html">link us</A> ]</FONT>
+</CENTER>
+<P>
+</BODY>
+</HTML>
diff --git a/result/HTML/test3.html b/result/HTML/test3.html
new file mode 100644
index 0000000..0c47a2e
--- /dev/null
+++ b/result/HTML/test3.html
@@ -0,0 +1,88 @@
+<!DOCTYPE HTML>
+<HTML>
+<HEAD>
+<BASE target="contents">
+</HEAD>
+<A name="ProblemDomain.Package">
+<H2>Component Package diagram ProblemDomain</H2>
+</A>
+<P>
+<HR>
+<DL>
+<DT>
+<B>Stereotype </B>problem domain</DT>
+<DT>
+<B>Alias </B>Problem Domain</DT>
+<DT>
+<B>Note </B>
+<DD>The Problem Domain package is the model behind the Human
+<DD>Interface, thats stores and manipulates the Family Tree.
+</DD>
+</DD>
+</DT>
+</DL>
+<P>
+<HR>
+<DL>
+<DT>
+<H4>Class <A href="HumanInterface.FamilyFrame.html#HumanInterface.FamilyFrame">HumanInterface.FamilyFrame</A>
+</H4>
+</DT>
+<DT>
+<H4>Class <A href="ProblemDomain.Birth.html#ProblemDomain.Birth">ProblemDomain.Birth</A>
+</H4>
+</DT>
+<DT>
+<H4>Class <A href="ProblemDomain.Death.html#ProblemDomain.Death">ProblemDomain.Death</A>
+</H4>
+</DT>
+<DT>
+<H4>Class <A href="ProblemDomain.Divorce.html#ProblemDomain.Divorce">ProblemDomain.Divorce</A>
+</H4>
+</DT>
+<DT>
+<H4>Class <A href="ProblemDomain.Family.html#ProblemDomain.Family">ProblemDomain.Family</A>
+</H4>
+</DT>
+<DT>
+<H4>Class <A href="ProblemDomain.Individual.html#ProblemDomain.Individual">ProblemDomain.Individual</A>
+</H4>
+</DT>
+<DT>
+<H4>Class <A href="ProblemDomain.LifeEvent.html#ProblemDomain.LifeEvent">ProblemDomain.LifeEvent</A>
+</H4>
+</DT>
+<DT>
+<H4>Class <A href="ProblemDomain.Marriage.html#ProblemDomain.Marriage">ProblemDomain.Marriage</A>
+</H4>
+</DT>
+<DT>
+<H4>Class <A href="ProblemDomain.Note.html#ProblemDomain.Note">ProblemDomain.Note</A>
+</H4>
+</DT>
+</DL>
+<H4>
+<B>Links</B>
+</H4>
+<UL>
+<LI>
+<B>Link to </B>
+<A href="HumanInterface.Package.html#HumanInterface.Package">HumanInterface</A>
+</LI>
+</UL>
+<DIR></DIR>
+<UL>
+<LI>
+<B>Link to </B>
+<A href="DataManagement.FlatFile.Package.html#DataManagement.FlatFile.Package">DataManagement.FlatFile</A>
+</LI>
+</UL>
+<DIR></DIR>
+<UL>
+<LI>
+<B>Link to </B>
+<A href="DataManagement.Package.html#DataManagement.Package">DataManagement</A>
+</LI>
+</UL>
+<DIR></DIR>
+</HTML>
diff --git a/test/HTML/Down.html b/test/HTML/Down.html
new file mode 100644
index 0000000..0f36647
--- /dev/null
+++ b/test/HTML/Down.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+ "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<head>
+ <title>This service is temporary down</title>
+</head>
+
+<body bgcolor="#FFFFFF">
+<h1 align="center">Sorry, this service is temporary down</h1>
+We are doing our best to get it back on-line,
+
+<p>The W3C system administrators</p>
+</body>
+</html>
diff --git a/test/HTML/test2.html b/test/HTML/test2.html
new file mode 100644
index 0000000..c8fd44c
--- /dev/null
+++ b/test/HTML/test2.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<HTML><HEAD> <TITLE>Linux Today</TITLE></HEAD>
+<body bgcolor="White" link="Blue" text="Black" VLINK="Black" ALINK="Red">
+
+<center>
+<TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0">
+ <TR BGCOLOR="#FFFFFF">
+ <TD HEIGHT="90">
+<a href="http://linuxtoday.com/cgi-bin/click.pl?adnum=49"><img src="/pics/door_linux.gif" border="0" width="468" height="60" alt="Atipa Linux solutions. Your reliable cluster, server, and workstation solution. Win a Free Celeron Linux Workstation!"></A>
+
+ </TD>
+ <TD><IMG SRC="/pics/lt.gif" VSPACE=5 alt="Linux Today Logo"><br><font size="-1"><a href="http://linux.com">linux.com</a> partner</font><p></TD>
+
+ </TR>
+</TABLE>
+<font size="2" face="Helvetica">
+[ <a href="http://linuxtoday.com/">headlines</A> |
+<a href="http://features.linuxtoday.com/">features</A> |
+<a href="http://commercial.linuxtoday.com/">commercial</a> |
+<a href="http://security.linuxtoday.com/">security</a> |
+<a href="http://jobs.linuxtoday.com/">jobs</a> |
+<a href="http://linuxtoday.com/volt/">volt</a> |
+<a href="http://linuxtoday.com/contrib.pl">contribute/submit</a> |
+<a href="http://linuxtoday.com/advertise/">advertise</A> |
+<a href="http://linuxtoday.com/search.html">search</A> |
+<a href="http://linuxtoday.com/digests/">site digests</A> |
+<a href="http://linuxtoday.com/mail-lists">mailing lists</A> |
+<a href="http://linuxtoday.com/about/">about us</a> |
+<a href="http://linuxtoday.com/linkus.html">link us</A> ]</font>
+</center>
+<P>
+</body>
+</html>
diff --git a/test/HTML/test3.html b/test/HTML/test3.html
new file mode 100644
index 0000000..af1f190
--- /dev/null
+++ b/test/HTML/test3.html
@@ -0,0 +1,34 @@
+<html>
+<head>
+<base target=contents>
+</head>
+<a name=ProblemDomain.Package><h2>Component Package diagram ProblemDomain</h2>
+</a><p><hr></p>
+<dl>
+<dt><b>Stereotype </b>problem domain</dt>
+<dt><b>Alias </b>Problem Domain</dt>
+<dt><b>Note </b><dd>The Problem Domain package is the model behind the Human
+<dd>Interface, thats stores and manipulates the Family Tree.
+</dl>
+<p><hr></p>
+<dl>
+
+<dt><h4>Class <a href=HumanInterface.FamilyFrame.html#HumanInterface.FamilyFrame>HumanInterface.FamilyFrame</a></h4></dt>
+<dt><h4>Class <a href=ProblemDomain.Birth.html#ProblemDomain.Birth>ProblemDomain.Birth</a></h4></dt>
+<dt><h4>Class <a href=ProblemDomain.Death.html#ProblemDomain.Death>ProblemDomain.Death</a></h4></dt>
+<dt><h4>Class <a href=ProblemDomain.Divorce.html#ProblemDomain.Divorce>ProblemDomain.Divorce</a></h4></dt>
+<dt><h4>Class <a href=ProblemDomain.Family.html#ProblemDomain.Family>ProblemDomain.Family</a></h4></dt>
+<dt><h4>Class <a href=ProblemDomain.Individual.html#ProblemDomain.Individual>ProblemDomain.Individual</a></h4></dt>
+<dt><h4>Class <a href=ProblemDomain.LifeEvent.html#ProblemDomain.LifeEvent>ProblemDomain.LifeEvent</a></h4></dt>
+<dt><h4>Class <a href=ProblemDomain.Marriage.html#ProblemDomain.Marriage>ProblemDomain.Marriage</a></h4></dt>
+<dt><h4>Class <a href=ProblemDomain.Note.html#ProblemDomain.Note>ProblemDomain.Note</a></h4></dt>
+</dl>
+
+<h4><b>Links</h4></b>
+<ul><li><b>Link to </b><a href=HumanInterface.Package.html#HumanInterface.Package>HumanInterface</a></li></ul>
+<dir></dir>
+<ul><li><b>Link to </b><a href=DataManagement.FlatFile.Package.html#DataManagement.FlatFile.Package>DataManagement.FlatFile</a></li></ul>
+<dir></dir>
+<ul><li><b>Link to </b><a href=DataManagement.Package.html#DataManagement.Package>DataManagement</a></li></ul>
+<dir></dir>
+</html>
diff --git a/testHTML.c b/testHTML.c
index 4b214fa..27afe35 100644
--- a/testHTML.c
+++ b/testHTML.c
@@ -27,7 +27,7 @@
#include <stdlib.h>
#include "HTMLparser.h"
-#include "tree.h"
+#include "HTMLtree.h"
#include "debugXML.h"
static int debug = 0;
@@ -80,7 +80,7 @@
* print it.
*/
if (!debug)
- xmlDocDump(stdout, doc);
+ htmlDocDump(stdout, doc);
else
xmlDebugDumpDocument(stdout, doc);
@@ -111,7 +111,7 @@
* print it.
*/
if (!debug)
- xmlDocDump(stdout, doc);
+ htmlDocDump(stdout, doc);
else
xmlDebugDumpDocument(stdout, doc);