From 1566d3a91b50e08f8bd928da5a06d9c53a99747f Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Thu, 15 Jul 1999 14:24:29 +0000 Subject: [PATCH] Added XPath code (http://www.w3.org/TR/xpath), updated HTML support and docs, Daniel --- ChangeLog | 13 + HTMLparser.c | 1 + HTMLtree.c | 7 +- Makefile.am | 57 +- configure.in | 2 +- debugXML.c | 6 +- debugXML.h | 1 + doc/gnome-xml.sgml | 8 + doc/html/book1.html | 15 + doc/html/gnome-xml-entities.html | 281 +- doc/html/gnome-xml-htmlparser.html | 1409 +++++++++ doc/html/gnome-xml-htmltree.html | 671 ++++ doc/html/gnome-xml-parser.html | 772 +++-- doc/html/gnome-xml-parserinternals.html | 457 +-- doc/html/gnome-xml-tree.html | 735 ++--- doc/html/gnome-xml-valid.html | 191 +- doc/html/gnome-xml-xml-error.html | 473 +++ doc/html/gnome-xml-xpath.html | 1027 +++++++ doc/html/index.sgml | 45 + doc/html/libxml.html | 4 + include/libxml/debugXML.h | 1 + include/libxml/parser.h | 4 +- include/libxml/xpath.h | 108 + parser.c | 57 +- parser.h | 4 +- result/XPath/expr/base | 5 + result/XPath/expr/functions | 5 + result/XPath/expr/strings | 19 + result/XPath/tests/chaptersbase | 36 + result/XPath/tests/simpleabbr | 25 + result/XPath/tests/simplebase | 24 + test/XPath/docs/chapters | 28 + test/XPath/docs/simple | 12 + test/XPath/expr/base | 5 + test/XPath/expr/functions | 5 + test/XPath/expr/strings | 19 + test/XPath/tests/chaptersbase | 7 + test/XPath/tests/simpleabbr | 6 + test/XPath/tests/simplebase | 7 + testXPath.c | 193 ++ tester.c | 2 +- xpath.c | 3698 +++++++++++++++++++++++ xpath.h | 108 + 43 files changed, 9353 insertions(+), 1200 deletions(-) create mode 100644 doc/html/gnome-xml-htmlparser.html create mode 100644 doc/html/gnome-xml-htmltree.html create mode 100644 doc/html/gnome-xml-xml-error.html create mode 100644 doc/html/gnome-xml-xpath.html create mode 100644 include/libxml/xpath.h create mode 100644 result/XPath/expr/base create mode 100644 result/XPath/expr/functions create mode 100644 result/XPath/expr/strings create mode 100644 result/XPath/tests/chaptersbase create mode 100644 result/XPath/tests/simpleabbr create mode 100644 result/XPath/tests/simplebase create mode 100644 test/XPath/docs/chapters create mode 100644 test/XPath/docs/simple create mode 100644 test/XPath/expr/base create mode 100644 test/XPath/expr/functions create mode 100644 test/XPath/expr/strings create mode 100644 test/XPath/tests/chaptersbase create mode 100644 test/XPath/tests/simpleabbr create mode 100644 test/XPath/tests/simplebase create mode 100644 testXPath.c create mode 100644 xpath.c create mode 100644 xpath.h diff --git a/ChangeLog b/ChangeLog index d440cd00..748e177a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Thu Jul 15 16:17:16 CEST 1999 Daniel Veillard + + * 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 * parser.c, HTMLparser.c: applied patch from John Ellson diff --git a/HTMLparser.c b/HTMLparser.c index 77724444..ce39a4be 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -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" }, diff --git a/HTMLtree.c b/HTMLtree.c index 0d4b45f1..2a05b3ed 100644 --- a/HTMLtree.c +++ b/HTMLtree.c @@ -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) { diff --git a/Makefile.am b/Makefile.am index 0f239c3c..294bcde2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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'. diff --git a/configure.in b/configure.in index 83c5c4c2..93328050 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/debugXML.c b/debugXML.c index 5abec63e..c47c0b36 100644 --- a/debugXML.c +++ b/debugXML.c @@ -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); } diff --git a/debugXML.h b/debugXML.h index 2be4826d..556d1fe1 100644 --- a/debugXML.h +++ b/debugXML.h @@ -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); diff --git a/doc/gnome-xml.sgml b/doc/gnome-xml.sgml index e7442bd4..96eb97aa 100644 --- a/doc/gnome-xml.sgml +++ b/doc/gnome-xml.sgml @@ -4,6 +4,10 @@ + + + + ]> @@ -15,11 +19,15 @@ Gnome XML Library &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 diff --git a/doc/html/book1.html b/doc/html/book1.html index 8f8a6084..09efeb7e 100644 --- a/doc/html/book1.html +++ b/doc/html/book1.html @@ -83,6 +83,21 @@ HREF="gnome-xml-xml-error.html" HREF="gnome-xml-parserinternals.html" >parserInternals —
HTMLparser
HTMLtree
xpath

Name

Synopsis

CHAR *name); +const CHAR* xmlEncodeEntities (xmlDocPtr doc, + const CHAR *input); CHAR* xmlEncodeEntities (xmlEncodeEntitiesReentrant (xmlDocPtr doc, @@ -316,7 +330,7 @@ HREF="gnome-xml-entities.html#XMLENTITIESTABLEPTR" >

Description

Details

#define XML_INTERNAL_GENERAL_ENTITY		1
#define XML_INTERNAL_GENERAL_ENTITY

#define XML_EXTERNAL_GENERAL_PARSED_ENTITY	2
#define XML_EXTERNAL_GENERAL_PARSED_ENTITY

#define XML_EXTERNAL_GENERAL_UNPARSED_ENTITY	3
#define XML_EXTERNAL_GENERAL_UNPARSED_ENTITY

#define XML_INTERNAL_PARAMETER_ENTITY		4
#define XML_INTERNAL_PARAMETER_ENTITY

#define XML_EXTERNAL_PARAMETER_ENTITY		5
#define XML_EXTERNAL_PARAMETER_ENTITY

#define XML_INTERNAL_PREDEFINED_ENTITY		6
#define XML_INTERNAL_PREDEFINED_ENTITY

xmlEntityPtr

typedef xmlEntity *xmlEntityPtr;


#define XML_MIN_ENTITIES_TABLE	32
#define XML_MIN_ENTITIES_TABLE

xmlEntitiesTablePtr

typedef xmlEntitiesTable *xmlEntitiesTablePtr;


the document  the entity name  the entity type XML_xxx_yyy_ENTITY  the entity external ID if available  the entity system ID if available  the entity content 


the document  the entity name  the entity type XML_xxx_yyy_ENTITY  the entity external ID if available  the entity system ID if available  the entity content 


the entity name NULL if not, othervise the entity 


the document referencing the entity  the entity name A pointer to the entity structure or NULL if not found. 


the document referencing the entity  the entity name A pointer to the entity structure or NULL if not found. 


const CHAR*       xmlEncodeEntities               (* xmlEncodeEntities               (xmlDocPtr doc,
@@ -1222,6 +1210,119 @@ and non ASCII values with their entities and CharRef counterparts.

TODO !!!! Once moved to UTF-8 internal encoding, the encoding of non-ascii get erroneous.

TODO This routine is not reentrant, the interface +should not be modified though.

People must migrate their code to xmlEncodeEntitiesReentrant !

doc : 
input : 
Returns : 


xmlEncodeEntitiesReentrant ()

CHAR*       xmlEncodeEntitiesReentrant      (xmlDocPtr doc,
+                                             const CHAR *input);

Do a global encoding of a string, replacing the predefined entities +and non ASCII values with their entities and CharRef counterparts. +Contrary to xmlEncodeEntities, this routine is reentrant, and result +must be deallocated.

TODO !!!! Once moved to UTF-8 internal encoding, the encoding of non-ascii +get erroneous.

the document containing the string  A string to convert to XML. A newly allocated string with the substitution done. 


the xmlEntitiesTablePtr just created or NULL in case of error. 


An entity table the new xmlEntitiesTablePtr or NULL in case of error. 


An entity table 


An XML buffer.  An entity table 

HTMLparser

Gnome XML Library Reference Manual
<<< Previous PageHomeUpNext Page >>>

HTMLparser

Name

HTMLparser —

Synopsis


+
+typedef     htmlParserCtxt;
+typedef     htmlParserCtxtPtr;
+typedef     htmlParserNodeInfo;
+typedef     htmlSAXHandler;
+typedef     htmlSAXHandlerPtr;
+typedef     htmlParserInput;
+typedef     htmlParserInputPtr;
+typedef     htmlDocPtr;
+typedef     htmlNodePtr;
+htmlElemDescPtr htmlTagLookup               (const CHAR *tag);
+htmlEntityDescPtr htmlEntityLookup          (const CHAR *name);
+htmlEntityDescPtr htmlParseEntityRef        (htmlParserCtxtPtr ctxt,
+                                             CHAR **str);
+int         htmlParseCharRef                (htmlParserCtxtPtr ctxt);
+void        htmlParseElement                (htmlParserCtxtPtr ctxt);
+htmlDocPtr  htmlSAXParseDoc                 (CHAR *cur,
+                                             const char *encoding,
+                                             htmlSAXHandlerPtr sax,
+                                             void *userData);
+htmlDocPtr  htmlParseDoc                    (CHAR *cur,
+                                             const char *encoding);
+htmlDocPtr  htmlSAXParseFile                (const char *filename,
+                                             const char *encoding,
+                                             htmlSAXHandlerPtr sax,
+                                             void *userData);
+htmlDocPtr  htmlParseFile                   (const char *filename,
+                                             const char *encoding);

Description

Details

htmlParserCtxt


htmlParserCtxtPtr


htmlParserNodeInfo


htmlSAXHandler


htmlSAXHandlerPtr


htmlParserInput


htmlParserInputPtr


htmlDocPtr


htmlNodePtr


htmlTagLookup ()

htmlElemDescPtr htmlTagLookup               (const CHAR *tag);

Lookup the HTML tag in the ElementTable

tag : 
Returns : 


htmlEntityLookup ()

htmlEntityDescPtr htmlEntityLookup          (const CHAR *name);

Lookup the given entity in EntitiesTable

TODO: the linear scan is really ugly, an hash table is really needed.

name : 
Returns : 


htmlParseEntityRef ()

htmlEntityDescPtr htmlParseEntityRef        (htmlParserCtxtPtr ctxt,
+                                             CHAR **str);

parse an HTML ENTITY references

[68] EntityRef ::= '&' Name ';'

ctxt : 
str : 
Returns : 


htmlParseCharRef ()

int         htmlParseCharRef                (htmlParserCtxtPtr ctxt);

parse Reference declarations

[66] CharRef ::= '&#' [0-9]+ ';' | +'&x' [0-9a-fA-F]+ ';'

ctxt : 
Returns : 


htmlParseElement ()

void        htmlParseElement                (htmlParserCtxtPtr ctxt);

parse an HTML element, this is highly recursive

[39] element ::= EmptyElemTag | STag content ETag

[41] Attribute ::= Name Eq AttValue

ctxt : 


htmlSAXParseDoc ()

htmlDocPtr  htmlSAXParseDoc                 (CHAR *cur,
+                                             const char *encoding,
+                                             htmlSAXHandlerPtr sax,
+                                             void *userData);

parse an HTML in-memory document and build a tree. +It use the given SAX function block to handle the parsing callback. +If sax is NULL, fallback to the default DOM tree building routines.

cur : 
encoding : 
sax : 
userData : 
Returns : 


htmlParseDoc ()

htmlDocPtr  htmlParseDoc                    (CHAR *cur,
+                                             const char *encoding);

parse an HTML in-memory document and build a tree.

cur : 
encoding : 
Returns : 


htmlSAXParseFile ()

htmlDocPtr  htmlSAXParseFile                (const char *filename,
+                                             const char *encoding,
+                                             htmlSAXHandlerPtr sax,
+                                             void *userData);

parse an HTML file and build a tree. Automatic support for ZLIB/Compress +compressed document is provided by default if found at compile-time. +It use the given SAX function block to handle the parsing callback. +If sax is NULL, fallback to the default DOM tree building routines.

filename : 
encoding : 
sax : 
userData : 
Returns : 


htmlParseFile ()

htmlDocPtr  htmlParseFile                   (const char *filename,
+                                             const char *encoding);

parse an HTML file and build a tree. Automatic support for ZLIB/Compress +compressed document is provided by default if found at compile-time.

filename : 
encoding : 
Returns : 

\ No newline at end of file diff --git a/doc/html/gnome-xml-htmltree.html b/doc/html/gnome-xml-htmltree.html new file mode 100644 index 00000000..83ba56b4 --- /dev/null +++ b/doc/html/gnome-xml-htmltree.html @@ -0,0 +1,671 @@ +HTMLtree
Gnome XML Library Reference Manual
<<< Previous PageHomeUpNext Page >>>

HTMLtree

Name

HTMLtree —

Synopsis


+
+#define     HTML_TEXT_NODE
+#define     HTML_ENTITY_REF_NODE
+#define     HTML_COMMENT_NODE
+void        htmlDocDumpMemory               (xmlDocPtr cur,
+                                             CHAR **mem,
+                                             int *size);
+void        htmlDocDump                     (FILE *f,
+                                             xmlDocPtr cur);
+int         htmlSaveFile                    (const char *filename,
+                                             xmlDocPtr cur);

Description

Details

HTML_TEXT_NODE

#define HTML_TEXT_NODE		XML_TEXT_NODE


HTML_ENTITY_REF_NODE

#define HTML_ENTITY_REF_NODE	XML_ENTITY_REF_NODE


HTML_COMMENT_NODE

#define HTML_COMMENT_NODE	XML_COMMENT_NODE


htmlDocDumpMemory ()

void        htmlDocDumpMemory               (xmlDocPtr cur,
+                                             CHAR **mem,
+                                             int *size);

Dump an HTML document in memory and return the CHAR * and it's size. +It's up to the caller to free the memory.

cur : the document
mem : OUT: the memory pointer
size : OUT: the memory lenght


htmlDocDump ()

void        htmlDocDump                     (FILE *f,
+                                             xmlDocPtr cur);

Dump an HTML document to an open FILE.

f : the FILE*
cur : the document


htmlSaveFile ()

int         htmlSaveFile                    (const char *filename,
+                                             xmlDocPtr cur);

Dump an HTML document to a file.

filename : the filename
cur : the document
Returns : the number of byte written or -1 in case of failure.

\ No newline at end of file diff --git a/doc/html/gnome-xml-parser.html b/doc/html/gnome-xml-parser.html index 696b3fd6..03433c0e 100644 --- a/doc/html/gnome-xml-parser.html +++ b/doc/html/gnome-xml-parser.html @@ -443,6 +443,10 @@ typedef xmlSAXHandlerPtr; +extern const char *xmlParserVersion; extern xmlSAXLocator xmlDefaultSAXLocatorxmlDefaultSAXHandler; +extern xmlSAXHandler htmlDefaultSAXHandler; CHARCHAR* xmlStrsub (const CHAR *str, + int start, + int len); +const CHAR* xmlStrchr (const CHAR val); +const CHAR* xmlStrstr (const CHAR *str, + CHAR *val); int xmlStrcmpxmlDefaultSAXHandlerInit (void); (void); +void htmlDefaultSAXHandlerInit (void);

Description

Details

#define XML_DEFAULT_VERSION	"1.0"
#define XML_DEFAULT_VERSION


xmlParserInputPtr

typedef xmlParserInput *xmlParserInputPtr;


xmlParserNodeInfo

typedef _xmlParserNodeInfo xmlParserNodeInfo;


xmlParserNodeInfoSeq

typedef _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;


xmlParserNodeInfoSeqPtr

typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;


xmlParserCtxt

typedef _xmlParserCtxt xmlParserCtxt;


xmlParserCtxtPtr

typedef xmlParserCtxt *xmlParserCtxtPtr;

xmlSAXLocator

typedef _xmlSAXLocator xmlSAXLocator;
xmlParserCtxtPtr


xmlSAXLocator


xmlSAXLocatorPtr

typedef xmlSAXLocator *xmlSAXLocatorPtr;



























xmlSAXHandlerPtr


xmlParserVersion

typedef xmlSAXHandler *xmlSAXHandlerPtr;
extern const char *xmlParserVersion;



htmlDefaultSAXHandler

extern xmlSAXHandler htmlDefaultSAXHandler;


the input CHAR * a new CHAR * or NULL 


the input CHAR *  the len of cur a new CHAR * or NULL 


xmlStrsub ()

CHAR*       xmlStrsub                       (const CHAR *str,
+                                             int start,
+                                             int len);

Extract a substring of a given string

str : 
start : 
len : 
Returns : 


const CHAR*       xmlStrchr                       (const * xmlStrchr                       (const CHAR *str,
@@ -3886,7 +3971,7 @@ CLASS="PARAMETER"
 WIDTH="80%"
 ALIGN="LEFT"
 VALIGN="TOP"
->  the CHAR * array   the CHAR to search the CHAR * for the first occurence or NULL. 


xmlStrstr ()

const CHAR* xmlStrstr                       (const CHAR *str,
+                                             CHAR *val);

a strstr for CHAR's

str : 
val : 
Returns : 


the first CHAR *  the second CHAR * the integer result of the comparison 


the first CHAR *  the second CHAR *  the max comparison length the integer result of the comparison 


the CHAR * array the number of CHAR contained in the ARRAY. 


the original CHAR * array  the CHAR * array added a new CHAR * containing the concatenated string. 


the original CHAR * array  the CHAR * array added  the length of add a new CHAR * containing the concatenated string. 


a pointer to an array of CHAR the resulting document tree 


an pointer to a char array  the size of the array the resulting document tree 


the filename the resulting document tree 


int 0 or 1  the last value for 0 for no substitution, 1 for substitution. 


a pointer to an array of CHAR the resulting document tree 


an pointer to a char array  the size of the array the resulting document tree 


the filename the resulting document tree 


an XML parser context 0, -1 in case of error. the parser context is augmented -as a result of the parsing. 


the SAX handler block  a pointer to an array of CHAR  work in recovery mode, i.e. tries to read no Well Formed -documents the resulting document tree 


the SAX handler block  an pointer to a char array  the siwe of the array  work in recovery mode, i.e. tries to read no Well Formed -documents the resulting document tree 


the SAX handler block  the filename  work in recovery mode, i.e. tries to read no Well Formed -documents the resulting document tree 


a NAME* containing the External ID of the DTD  a NAME* containing the URL to the DTD the resulting xmlDtdPtr or NULL in case of error. 


the SAX handler block  a NAME* containing the External ID of the DTD  a NAME* containing the URL to the DTD the resulting xmlDtdPtr or NULL in case of error. 


an XML parser context 


an XML parser context 


an XML parser context  a CHAR * buffer  a file name 


an XML parser context  an XML node within the tree an xmlParserNodeInfo block pointer or NULL 


a node info sequence pointer 


a node info sequence pointer 


a node info sequence pointer  an XML node pointer a long indicating the position of the record 


an XML parser context  a node info sequence pointer 



htmlDefaultSAXHandlerInit ()

void        htmlDefaultSAXHandlerInit       (void);

Initialize the default SAX handler

Name

Synopsis

Description

Details













Create a parser context for an XML in-memory document.


the filename the new parser context or NULL 


an pointer to a char array  the siwe of the array the new parser context or NULL 


an XML parser context 


an XML parser context  an XML entity pointer. 


an XML parser context  an Entity pointer the new input stream 


an XML parser context  an XML parser input fragment (entity, XML fragment ...). 


an XML parser context the current CHAR in the parser context 


an xmlParserInputPtr 


an XML parser context  the filename to use as entity the new input stream or NULL in case of error 


an XML parser context  a CHAR **  the function returns the local part, and prefix is updated -to get the Prefix if any. 


an XML parser context the namespace name or NULL 


an XML parser context  a CHAR **  the function returns the local part, and prefix is updated -to get the Prefix if any. 


an XML parser context the namespace name 


an XML parser context the string parser or NULL. 


an XML parser context 


an XML parser context the Name parsed or NULL 


an XML parser context the Nmtoken parsed or NULL 


an XML parser context  if non-NULL store a copy of the original entity value the EntityValue parsed with reference substitued or NULL 


an XML parser context the AttValue parsed or NULL. 


an XML parser context the SystemLiteral parsed or NULL 


an XML parser context the PubidLiteral parsed or NULL. 


an XML parser context  int indicating whether we are within a CDATA section 


an XML parser context  a CHAR** receiving PubidLiteral  indicate whether we should restrict parsing to only -production [75], see NOTE below the function returns SystemLiteral and in the second -case publicID receives PubidLiteral, is strict is off -it is possible to return NULL and have publicID set. 


an XML parser context  should we create a node, or just skip the content 


an XML parser context the PITarget name or NULL 


an XML parser context 


an XML parser context 


an XML parser context 


an XML parser context  Receive a possible fixed default value for the attribute  XML_ATTRIBUTE_NONE, XML_ATTRIBUTE_REQUIRED, XML_ATTRIBUTE_IMPLIED -or XML_ATTRIBUTE_FIXED.  


an XML parser context  the notation attribute tree built while parsing 


an XML parser context  the enumeration attribute tree built while parsing 


an XML parser context  the enumeration tree built while parsing  XML_ATTRIBUTE_ENUMERATION or XML_ATTRIBUTE_NOTATION 



#define XML_SUBSTITUTE_REF	1
#define XML_SUBSTITUTE_REF

#define XML_SUBSTITUTE_PEREF	2
#define XML_SUBSTITUTE_PEREF

#define XML_SUBSTITUTE_BOTH 	3
#define XML_SUBSTITUTE_BOTH

the parser context  the len to decode (in bytes !), -1 for no size limit  combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF  an end marker CHAR, 0 if none  an end marker CHAR, 0 if none  an end marker CHAR, 0 if none A newly allocated string with the substitution done. The caller -must deallocate it ! 





 Next Page >>> HTMLparser

Name

Synopsis

Description

Details



xmlNotationPtr

typedef xmlNotation *xmlNotationPtr;




xmlEnumerationPtr

typedef xmlEnumeration *xmlEnumerationPtr;


xmlAttributePtr

typedef xmlAttribute *xmlAttributePtr;




xmlElementContentPtr

typedef xmlElementContent *xmlElementContentPtr;



xmlElementPtr

typedef xmlElement *xmlElementPtr;



xmlNsPtr

typedef xmlNs *xmlNsPtr;


xmlDtdPtr

typedef xmlDtd *xmlDtdPtr;


xmlAttrPtr

typedef xmlAttr *xmlAttrPtr;


xmlNode

typedef _xmlNode xmlNode;


xmlNodePtr

typedef _xmlNode *xmlNodePtr;


xmlDoc

typedef _xmlDoc xmlDoc;


xmlDocPtr

typedef xmlDoc *xmlDocPtr;


xmlBuffer

typedef _xmlBuffer xmlBuffer;


xmlBufferPtr

typedef xmlBuffer *xmlBufferPtr;





the new structure. 


the buffer to free 


the file output  the buffer to dump the number of CHAR written 


the buffer to dump  the CHAR string  the number of CHAR to add 


the buffer to dump  the CHAR string 


the buffer to dump  the C char string 


the document pointer  the DTD name  the external ID  the system ID a pointer to the new DTD structure 


the document pointer  the DTD name  the external ID  the system ID a pointer to the new DTD structure 


the DTD structure to free up 


the document carrying the namespace  the URI associated  the prefix for the namespace returns a new namespace pointer 


the element carrying the namespace  the URI associated  the prefix for the namespace returns a new namespace pointer 


the namespace pointer 


CHAR string giving the version of XML "1.0" a new document 


pointer to the document -@:  


the document  the name of the attribute  the value of the attribute a pointer to the attribute 


the holding node  the name of the attribute  the value of the attribute a pointer to the attribute 


the first property in the list 


the first property in the list 


the attribute  a new xmlAttrPtr, or NULL in case of error. 


the first attribute  a new xmlAttrPtr, or NULL in case of error. 


the dtd  a new xmlDtdPtr, or NULL in case of error. 


the document  if 1 do a recursive copy.  a new xmlDocPtr, or NULL in case of error. 


the document  namespace if any  the node name  the text content if any a pointer to the new node object. 


namespace if any  the node name a pointer to the new node object. 


the parent node  a namespace if any  the name of the child  the content of the child if any. a pointer to the new node object. 


the document  the text content a pointer to the new node object. 


the text content a pointer to the new node object. 


the document  the text content  the text len. a pointer to the new node object. 


the text content  the text len. a pointer to the new node object. 


the document  the comment content a pointer to the new node object. 


the comment content a pointer to the new node object. 


the document  the reference name, or the reference string with & and ; a pointer to the new node object. 


the node  if 1 do a recursive copy.  a new xmlNodePtr, or NULL in case of error. 


the first node in the list.  a new xmlNodePtr, or NULL in case of error. 


the parent node the last child or NULL if none. 


the node 1 yes, 0 no 


the parent node  the child node the child or NULL in case of error. 


the node 


the first text node  the second text node being merged the first text node augmented 


the node  the content  content lenght 


the first node in the list 


the node 


the document  the current node  the namespace string the namespace pointer or NULL. 


the document  the current node  the namespace value the namespace pointer or NULL. 


a node in the document  a namespace pointer 


the namespace  a new xmlNsPtr, or NULL in case of error. 


the first namespace  a new xmlNsPtr, or NULL in case of error. 


the node  the attribute name  the attribute value the attribute pointer. 


the node  the attribute name the attribute value or NULL if not found. 


the document  the value of the attribute a pointer to the first child 


the document  the value of the text  the length of the string value a pointer to the first child 


the document  a Node list  should we replace entity contents or show their external form a pointer to the string copy, the calller must free it. 


the node being modified  the new value of the content 


the node being modified  the new value of the content  the size of content 


the node being modified  extra content 


the node being modified  extra content  the size of content 


the node being read a new CHAR * or NULL if no content is available. -It's up to the caller to free the memory. 


the XML buffer  the string to add 


the XML buffer output  the string to add 


the XML buffer output  the string to add 


the document  OUT: the memory pointer  OUT: the memory lenght 


the FILE*  the document 


the filename  the document  the number of file written or -1 in case of failure. 


the document 0 (uncompressed) to 9 (max compression) 


the document  the compression ratio 


0 (uncompressed) to 9 (max compression) 


the compression ratio 

Name

Synopsis

Description

Details

#define XML_MIN_NOTATION_TABLE	32
#define XML_MIN_NOTATION_TABLE

xmlNotationTablePtr

typedef xmlNotationTable *xmlNotationTablePtr;


#define XML_MIN_ELEMENT_TABLE	32
#define XML_MIN_ELEMENT_TABLE

xmlElementTablePtr

typedef xmlElementTable *xmlElementTablePtr;


#define XML_MIN_ATTRIBUTE_TABLE	32
#define XML_MIN_ATTRIBUTE_TABLE

xmlAttributeTablePtr

typedef xmlAttributeTable *xmlAttributeTablePtr;


pointer to the DTD  the entity name  the public identifier or NULL  the system identifier or NULL NULL if not, othervise the entity 


A notation table the new xmlNotationTablePtr or NULL in case of error. 


An notation table 


the XML buffer output  A notation table 


the subelement name or NULL  the type of element content decl NULL if not, othervise the new element content structure 


An element content pointer. the new xmlElementContentPtr or NULL in case of error. 


the element content tree to free 


pointer to the DTD  the entity name  the element type  the element content tree or NULL NULL if not, othervise the entity 


An element table the new xmlElementTablePtr or NULL in case of error. 


An element table 


the XML buffer output  An element table 


the enumeration name or NULL the xmlEnumerationPtr just created or NULL in case -of error. 


the tree to free. 


the tree to copy. the xmlEnumerationPtr just created or NULL in case -of error. 


pointer to the DTD  the element name  the attribute name  the attribute type  the attribute default type  the attribute default value  if it's an enumeration, the associated list NULL if not, othervise the entity 


An attribute table the new xmlAttributeTablePtr or NULL in case of error. 


An attribute table 


the XML buffer output  An attribute table 

xml-error

Gnome XML Library Reference Manual
<<< Previous PageHomeUpNext Page >>>

xml-error

Name

xml-error —

Synopsis


+
+void        xmlParserError                  (void *ctx,
+                                             const char *msg,
+                                             ...);
+void        xmlParserWarning                (void *ctx,
+                                             const char *msg,
+                                             ...);

Description

Details

xmlParserError ()

void        xmlParserError                  (void *ctx,
+                                             const char *msg,
+                                             ...);

Display and format an error messages, gives file, line, position and +extra parameters.

ctx : 
msg : 
... : 


xmlParserWarning ()

void        xmlParserWarning                (void *ctx,
+                                             const char *msg,
+                                             ...);

Display and format a warning messages, gives file, line, position and +extra parameters.

ctx : 
msg : 
... : 

\ No newline at end of file diff --git a/doc/html/gnome-xml-xpath.html b/doc/html/gnome-xml-xpath.html new file mode 100644 index 00000000..2c0172cc --- /dev/null +++ b/doc/html/gnome-xml-xpath.html @@ -0,0 +1,1027 @@ +xpath
Gnome XML Library Reference Manual
<<< Previous PageHomeUp 

xpath

Name

xpath —

Synopsis


+
+#define     XPATH_UNDEFINED
+#define     XPATH_NODESET
+#define     XPATH_BOOLEAN
+#define     XPATH_NUMBER
+#define     XPATH_STRING
+#define     XPATH_MARKER
+void        (*xmlXPathFunction)             (xmlXPathParserContextPtr ctxt,
+                                             int nargs);
+xmlXPathContextPtr xmlXPathNewContext       (xmlDocPtr doc,
+                                             void *variables,
+                                             void *functions,
+                                             void *namespaces);
+void        xmlXPathFreeContext             (xmlXPathContextPtr ctxt);
+xmlXPathObjectPtr xmlXPathEval              (const CHAR *str,
+                                             xmlXPathContextPtr ctxt);
+void        xmlXPathFreeObject              (xmlXPathObjectPtr obj);
+xmlXPathObjectPtr xmlXPathEvalExpression    (const CHAR *str,
+                                             xmlXPathContextPtr ctxt);

Description

Details

XPATH_UNDEFINED

#define     XPATH_UNDEFINED


XPATH_NODESET

#define     XPATH_NODESET


XPATH_BOOLEAN

#define     XPATH_BOOLEAN


XPATH_NUMBER

#define     XPATH_NUMBER


XPATH_STRING

#define     XPATH_STRING


XPATH_MARKER

#define     XPATH_MARKER


xmlXPathFunction ()

void        (*xmlXPathFunction)             (xmlXPathParserContextPtr ctxt,
+                                             int nargs);

ctxt : 
nargs : 


xmlXPathNewContext ()

xmlXPathContextPtr xmlXPathNewContext       (xmlDocPtr doc,
+                                             void *variables,
+                                             void *functions,
+                                             void *namespaces);

Create a new xmlXPathContext

doc : 
variables : 
functions : 
namespaces : 
Returns : 


xmlXPathFreeContext ()

void        xmlXPathFreeContext             (xmlXPathContextPtr ctxt);

Free up an xmlXPathContext

ctxt : 


xmlXPathEval ()

xmlXPathObjectPtr xmlXPathEval              (const CHAR *str,
+                                             xmlXPathContextPtr ctxt);

Evaluate the XPath Location Path in the given context.

str : 
ctxt : 
Returns : 


xmlXPathFreeObject ()

void        xmlXPathFreeObject              (xmlXPathObjectPtr obj);

Free up an xmlXPathObjectPtr object.

obj : 


xmlXPathEvalExpression ()

xmlXPathObjectPtr xmlXPathEvalExpression    (const CHAR *str,
+                                             xmlXPathContextPtr ctxt);

Evaluate the XPath expression in the given context.

str : 
ctxt : 
Returns : 

\ No newline at end of file diff --git a/doc/html/index.sgml b/doc/html/index.sgml index a0bdb076..69a29075 100644 --- a/doc/html/index.sgml +++ b/doc/html/index.sgml @@ -35,11 +35,15 @@ + + + + @@ -67,6 +71,7 @@ + @@ -176,6 +181,7 @@ + @@ -288,3 +294,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/html/libxml.html b/doc/html/libxml.html index 8abd7922..c12cb2fe 100644 --- a/doc/html/libxml.html +++ b/doc/html/libxml.html @@ -106,11 +106,15 @@ NAME="LIBXML" >Gnome XML Library

The parser general interfaces + The parser SAX interfaces Manipulation the tree generated by the parser Routines for handling entities All the stuff defined in DTDs Callbacks in case of parsing error Access to the parser internal routines + parsing HTML and generating a tree + printing HTML trees + A on-going XPath implementation