Commit 1566d3a9 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

Added XPath code (http://www.w3.org/TR/xpath), updated HTML support and docs, Daniel

parent d79d7870
Thu Jul 15 16:17:16 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* configure.in: upgraded to version 1.4.0
* xpath.c, xpath.h, testXPath.c, makefile.am: added code for the XPath
draft from W3C. Will be used by XPointer, Xlink, XSL, and possibly
XML query language, see http://www.w3.org/TR/xpath for more details.
* parser.c, parser.h: added CHAR* related string functions for XPath
* HTMLparser.[ch], HTMLtree.c: a bit of cleanup on entities.
* doc/gnome-xml.sgml, doc/html/* : added XPath and HTML documentation,
rebuild the docs.
* Makefile.am, test/XPath/*, result/XPath/*: added an XPathtests target
and regression testing capabilities for XPath.
Mon Jul 12 12:36:39 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* parser.c, HTMLparser.c: applied patch from John Ellson <ellson@lucent.com>
......
......@@ -456,6 +456,7 @@ htmlEntityDesc html40EntitiesTable[] = {
*/
{ 34, "quot", "quotation mark = APL quote, U+0022 ISOnum" },
{ 38, "amp", "ampersand, U+0026 ISOnum" },
{ 39, "apos", "single quote" },
{ 60, "lt", "less-than sign, U+003C ISOnum" },
{ 62, "gt", "greater-than sign, U+003E ISOnum" },
......
......@@ -37,8 +37,10 @@ htmlDtdDump(xmlBufferPtr buf, xmlDocPtr doc) {
if (cur->ExternalID != NULL) {
xmlBufferWriteChar(buf, " PUBLIC ");
xmlBufferWriteQuotedString(buf, cur->ExternalID);
xmlBufferWriteChar(buf, " ");
xmlBufferWriteQuotedString(buf, cur->SystemID);
if (cur->SystemID != NULL) {
xmlBufferWriteChar(buf, " ");
xmlBufferWriteQuotedString(buf, cur->SystemID);
}
} else if (cur->SystemID != NULL) {
xmlBufferWriteChar(buf, " SYSTEM ");
xmlBufferWriteQuotedString(buf, cur->SystemID);
......@@ -127,7 +129,6 @@ htmlNodeListDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
*/
static void
htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
int i;
htmlElemDescPtr info;
if (cur == NULL) {
......
......@@ -6,7 +6,7 @@ INCLUDES = -I@srcdir@ @CORBA_CFLAGS@ $(VERSION_FLAGS)
VERSION_FLAGS = -DLIBXML_VERSION=\"@LIBXML_VERSION@\"
noinst_PROGRAMS=tester testSAX testHTML
noinst_PROGRAMS=tester testSAX testHTML testXPath
bin_SCRIPTS=xml-config
......@@ -21,9 +21,10 @@ libxml_la_SOURCES = \
error.c \
parser.c \
HTMLparser.c \
HTMLtree.c \
debugXML.c \
tree.c \
HTMLtree.c \
xpath.c \
valid.c
xmlincdir = $(includedir)/gnome-xml
......@@ -32,10 +33,12 @@ xmlinc_HEADERS = \
encoding.h \
parser.h \
HTMLparser.h \
HTMLtree.h \
parserInternals.h \
debugXML.h \
xml-error.h \
tree.h \
xpath.h \
xmlIO.h \
valid.h
......@@ -57,9 +60,14 @@ testHTML_LDFLAGS =
testHTML_DEPENDENCIES = $(DEPS)
testHTML_LDADD= $(LDADDS)
testXPath_SOURCES=testXPath.c
testXPath_LDFLAGS =
testXPath_DEPENDENCIES = $(DEPS)
testXPath_LDADD= $(LDADDS)
check-local: tests
testall : tests SVGtests SAXtests
testall : tests SVGtests SAXtests XPathtests
tests: HTMLtests XMLtests
HTMLtests : testHTML
......@@ -110,6 +118,35 @@ SVGtests : tester
rm result.`basename $$i` result2.`basename $$i` ; \
fi ; fi ; done)
XPathtests : testXPath
@(DIR=`pwd`; cd $(srcdir) ; \
for i in test/XPath/expr/* ; do \
if [ ! -d $$i ] ; then \
if [ ! -f result/XPath/expr/`basename $$i` ] ; then \
echo New test file `basename $$i` ; \
$$DIR/testXPath -f --expr $$i > result/XPath/expr/`basename $$i` ; \
else \
echo Testing `basename $$i` ; \
$$DIR/testXPath -f --expr $$i > result.`basename $$i` ; \
diff result/XPath/expr/`basename $$i` result.`basename $$i` ; \
rm result.`basename $$i` ; \
fi ; fi ; done)
@(DIR=`pwd`; cd $(srcdir) ; \
for i in test/XPath/docs/* ; do \
if [ ! -d $$i ] ; then \
name=`basename $$i`; \
for j in test/XPath/tests/$$name* ; do \
if [ ! -d $$j ] ; then \
if [ ! -f result/XPath/tests/`basename $$j` ] ; then \
echo New test file `basename $$i` ; \
$$DIR/testXPath -f -i $$i $$j > result/XPath/tests/`basename $$j` ; \
else \
echo Testing `basename $$j` ; \
$$DIR/testXPath -f -i $$i $$j > result.`basename $$j` ; \
diff result/XPath/tests/`basename $$j` result.`basename $$j` ; \
rm result.`basename $$j` ; \
fi ; fi ; done ; fi ; done)
SAXtests : testSAX
@(DIR=`pwd`; cd $(srcdir) ; \
for i in test/* ; do \
......@@ -124,20 +161,6 @@ SAXtests : testSAX
rm result.`basename $$i` ; \
fi ; fi ; done)
#tests : tester
# @(for i in $(srcdir)/test/* ; do \
# if [ ! -d $$i ] ; then \
# j=`echo $$i | sed -e 's,^.*/,,'`; \
# if [ ! -f $(srcdir)/result/$$j ] ; then \
# echo New test file $$j ; \
# ./tester $$i > $(srcdir)/result/$$j ; \
# else \
# echo Testing $$j ; \
# ./tester $$i > result.$$j ; \
# diff $(srcdir)/result/$$j result.$$j ; \
# rm result.$$j ; \
# fi ; fi ; done)
## Put `exec' in the name because this should be installed by
## `install-exec', not `install-data'.
......
......@@ -4,7 +4,7 @@ AC_INIT(entities.h)
AM_CONFIG_HEADER(config.h)
LIBXML_MAJOR_VERSION=1
LIBXML_MINOR_VERSION=3
LIBXML_MINOR_VERSION=4
LIBXML_MICRO_VERSION=0
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
......
......@@ -113,7 +113,7 @@ void xmlDebugDumpAttrList(FILE *output, xmlAttrPtr attr, int depth) {
}
}
void xmlDebugDumpNode(FILE *output, xmlNodePtr node, int depth) {
void xmlDebugDumpOneNode(FILE *output, xmlNodePtr node, int depth) {
int i;
char shift[100];
......@@ -187,6 +187,10 @@ void xmlDebugDumpNode(FILE *output, xmlNodePtr node, int depth) {
if (ent != NULL)
xmlDebugDumpEntity(output, ent, depth + 1);
}
}
void xmlDebugDumpNode(FILE *output, xmlNodePtr node, int depth) {
xmlDebugDumpOneNode(output, node, depth);
if (node->childs != NULL)
xmlDebugDumpNodeList(output, node->childs, depth + 1);
}
......
......@@ -12,6 +12,7 @@
extern void xmlDebugDumpString(FILE *output, const CHAR *str);
extern void xmlDebugDumpAttr(FILE *output, xmlAttrPtr attr, int depth);
extern void xmlDebugDumpAttrList(FILE *output, xmlAttrPtr attr, int depth);
extern void xmlDebugDumpOneNode(FILE *output, xmlNodePtr node, int depth);
extern void xmlDebugDumpNode(FILE *output, xmlNodePtr node, int depth);
extern void xmlDebugDumpNodeList(FILE *output, xmlNodePtr node, int depth);
extern void xmlDebugDumpDocument(FILE *output, xmlDocPtr doc);
......
......@@ -4,6 +4,10 @@
<!entity entities SYSTEM "sgml/entities.sgml">
<!entity error SYSTEM "sgml/xml-error.sgml">
<!entity valid SYSTEM "sgml/valid.sgml">
<!entity xpath SYSTEM "sgml/xpath.sgml">
<!entity SAX SYSTEM "sgml/SAX.sgml">
<!entity HTMLparser SYSTEM "sgml/HTMLparser.sgml">
<!entity HTMLtree SYSTEM "sgml/HTMLtree.sgml">
<!entity parserInternals SYSTEM "sgml/parserInternals.sgml">
]>
......@@ -15,11 +19,15 @@
<chapter id="libxml">
<title>Gnome XML Library</title>
&parser; The parser general interfaces
&SAX; The parser SAX interfaces
&tree; Manipulation the tree generated by the parser
&entities; Routines for handling entities
&valid; All the stuff defined in DTDs
&error; Callbacks in case of parsing error
&parserInternals; Access to the parser internal routines
&HTMLparser; parsing HTML and generating a tree
&HTMLtree; printing HTML trees
&xpath; A on-going XPath implementation
</chapter>
</book>
......@@ -83,6 +83,21 @@ HREF="gnome-xml-xml-error.html"
HREF="gnome-xml-parserinternals.html"
>parserInternals</A
> &#8212; </DT
><DT
><A
HREF="gnome-xml-htmlparser.html"
>HTMLparser</A
> &#8212; </DT
><DT
><A
HREF="gnome-xml-htmltree.html"
>HTMLtree</A
> &#8212; </DT
><DT
><A
HREF="gnome-xml-xpath.html"
>xpath</A
> &#8212; </DT
></DL
></DD
></DL
......
......@@ -115,7 +115,7 @@ SIZE="3"
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN3522"
NAME="AEN3575"
></A
><H2
>Name</H2
......@@ -123,7 +123,7 @@ NAME="AEN3522"
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN3525"
NAME="AEN3578"
></A
><H2
>Synopsis</H2
......@@ -260,10 +260,10 @@ HREF="gnome-xml-tree.html#XMLDOCPTR"
HREF="gnome-xml-tree.html#CHAR"
>CHAR</A
> *name);
<A
const <A
HREF="gnome-xml-tree.html#CHAR"
>CHAR</A
>* <A
>* <A
HREF="gnome-xml-entities.html#XMLENCODEENTITIES"
>xmlEncodeEntities</A
> (<A
......@@ -275,6 +275,20 @@ HREF="gnome-xml-tree.html#CHAR"
>CHAR</A
> *input);
<A
HREF="gnome-xml-tree.html#CHAR"
>CHAR</A
>* <A
HREF="gnome-xml-entities.html#XMLENCODEENTITIESREENTRANT"
>xmlEncodeEntitiesReentrant</A
> (<A
HREF="gnome-xml-tree.html#XMLDOCPTR"
>xmlDocPtr</A
> doc,
const <A
HREF="gnome-xml-tree.html#CHAR"
>CHAR</A
> *input);
<A
HREF="gnome-xml-entities.html#XMLENTITIESTABLEPTR"
>xmlEntitiesTablePtr</A
> <A
......@@ -316,7 +330,7 @@ HREF="gnome-xml-entities.html#XMLENTITIESTABLEPTR"
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3574"
NAME="AEN3631"
></A
><H2
>Description</H2
......@@ -326,14 +340,14 @@ NAME="AEN3574"
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3577"
NAME="AEN3634"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
NAME="AEN3579"
NAME="AEN3636"
></A
><H3
><A
......@@ -349,7 +363,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
>#define XML_INTERNAL_GENERAL_ENTITY 1</PRE
>#define XML_INTERNAL_GENERAL_ENTITY</PRE
></TD
></TR
></TABLE
......@@ -359,7 +373,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3584"
NAME="AEN3641"
></A
><H3
><A
......@@ -375,7 +389,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
>#define XML_EXTERNAL_GENERAL_PARSED_ENTITY 2</PRE
>#define XML_EXTERNAL_GENERAL_PARSED_ENTITY</PRE
></TD
></TR
></TABLE
......@@ -385,7 +399,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3589"
NAME="AEN3646"
></A
><H3
><A
......@@ -401,7 +415,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
>#define XML_EXTERNAL_GENERAL_UNPARSED_ENTITY 3</PRE
>#define XML_EXTERNAL_GENERAL_UNPARSED_ENTITY</PRE
></TD
></TR
></TABLE
......@@ -411,7 +425,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3594"
NAME="AEN3651"
></A
><H3
><A
......@@ -427,7 +441,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
>#define XML_INTERNAL_PARAMETER_ENTITY 4</PRE
>#define XML_INTERNAL_PARAMETER_ENTITY</PRE
></TD
></TR
></TABLE
......@@ -437,7 +451,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3599"
NAME="AEN3656"
></A
><H3
><A
......@@ -453,7 +467,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
>#define XML_EXTERNAL_PARAMETER_ENTITY 5</PRE
>#define XML_EXTERNAL_PARAMETER_ENTITY</PRE
></TD
></TR
></TABLE
......@@ -463,7 +477,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3604"
NAME="AEN3661"
></A
><H3
><A
......@@ -479,7 +493,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
>#define XML_INTERNAL_PREDEFINED_ENTITY 6</PRE
>#define XML_INTERNAL_PREDEFINED_ENTITY</PRE
></TD
></TR
></TABLE
......@@ -489,33 +503,20 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3609"
NAME="AEN3666"
></A
><H3
><A
NAME="XMLENTITYPTR"
></A
>xmlEntityPtr</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>typedef xmlEntity *xmlEntityPtr;</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3614"
NAME="AEN3670"
></A
><H3
><A
......@@ -531,7 +532,7 @@ CELLPADDING="6"
><TD
><PRE
CLASS="PROGRAMLISTING"
>#define XML_MIN_ENTITIES_TABLE 32</PRE
>#define XML_MIN_ENTITIES_TABLE</PRE
></TD
></TR
></TABLE
......@@ -541,33 +542,20 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3619"
NAME="AEN3675"
></A
><H3
><A
NAME="XMLENTITIESTABLEPTR"
></A
>xmlEntitiesTablePtr</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>typedef xmlEntitiesTable *xmlEntitiesTablePtr;</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3624"
NAME="AEN3679"
></A
><H3
><A
......@@ -637,7 +625,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the document</TD
>&nbsp;</TD
></TR
><TR
><TD
......@@ -654,7 +642,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the entity name</TD
>&nbsp;</TD
></TR
><TR
><TD
......@@ -671,7 +659,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the entity type XML_xxx_yyy_ENTITY</TD
>&nbsp;</TD
></TR
><TR
><TD
......@@ -688,7 +676,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the entity external ID if available</TD
>&nbsp;</TD
></TR
><TR
><TD
......@@ -705,7 +693,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the entity system ID if available</TD
>&nbsp;</TD
></TR
><TR
><TD
......@@ -722,7 +710,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the entity content</TD
>&nbsp;</TD
></TR
></TABLE
><P
......@@ -732,7 +720,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3664"
NAME="AEN3719"
></A
><H3
><A
......@@ -802,7 +790,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the document</TD
>&nbsp;</TD
></TR
><TR
><TD
......@@ -819,7 +807,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the entity name</TD
>&nbsp;</TD
></TR
><TR
><TD
......@@ -836,7 +824,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the entity type XML_xxx_yyy_ENTITY</TD
>&nbsp;</TD
></TR
><TR
><TD
......@@ -853,7 +841,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the entity external ID if available</TD
>&nbsp;</TD
></TR
><TR
><TD
......@@ -870,7 +858,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the entity system ID if available</TD
>&nbsp;</TD
></TR
><TR
><TD
......@@ -887,7 +875,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the entity content</TD
>&nbsp;</TD
></TR
></TABLE
><P
......@@ -897,7 +885,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3704"
NAME="AEN3759"
></A
><H3
><A
......@@ -953,7 +941,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the entity name</TD
>&nbsp;</TD
></TR
><TR
><TD
......@@ -968,7 +956,7 @@ CLASS="EMPHASIS"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>NULL if not, othervise the entity</TD
>&nbsp;</TD
></TR
></TABLE
><P
......@@ -978,7 +966,7 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3725"
NAME="AEN3780"
></A
><H3
><A
......@@ -1040,7 +1028,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the document referencing the entity</TD
>&nbsp;</TD
></TR
><TR
><TD
......@@ -1057,7 +1045,7 @@ CLASS="PARAMETER"
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> the entity name</TD
>&nbsp;</TD