1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-27 03:21:26 +03:00

Various small bugfixes, Daniel.

This commit is contained in:
Daniel Veillard 1999-10-09 09:11:45 +00:00
parent 2673d3c856
commit 6077d03d0e
6 changed files with 58 additions and 52 deletions

View File

@ -1,3 +1,10 @@
Sat Oct 9 11:02:57 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* Makefile.am: Arturo patch for xmlConf.sh version info
* parser.c: Tim Josling patch for single quoted items
* tester.c: Tim Josling patch for tester options usage
* tree.h: indent cleanup
Fri Oct 8 16:35:37 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* HTMLparser.c parser.h : Fixed problems with HTML parsing

View File

@ -259,5 +259,6 @@ xmlConf.sh: xmlConf.sh.in Makefile
sed -e 's?\@XML_LIBDIR\@?$(XML_LIBDIR)?g' \
-e 's?\@XML_INCLUDEDIR\@?$(XML_INCLUDEDIR)?g' \
-e 's?\@XML_LIBS\@?$(XML_LIBS)?g' \
-e 's?\@VERSION\@?$(VERSION)?g' \
< $(srcdir)/xmlConf.sh.in > xmlConf.tmp \
&& mv xmlConf.tmp xmlConf.sh

View File

@ -99,17 +99,17 @@ typedef enum {
typedef struct xmlEnumeration {
struct xmlEnumeration *next; /* next one */
const xmlChar *name; /* Enumeration name */
const xmlChar *name; /* Enumeration name */
} xmlEnumeration;
typedef xmlEnumeration *xmlEnumerationPtr;
typedef struct xmlAttribute {
const xmlChar *elem; /* Element holding the attribute */
const xmlChar *name; /* Attribute name */
const xmlChar *elem; /* Element holding the attribute */
const xmlChar *name; /* Attribute name */
struct xmlAttribute *next; /* list of attributes of an element */
xmlAttributeType type; /* The type */
xmlAttributeDefault def; /* the default */
const xmlChar *defaultValue;/* or the default value */
const xmlChar *defaultValue;/* or the default value */
xmlEnumerationPtr tree; /* or the enumeration tree if any */
} xmlAttribute;
typedef xmlAttribute *xmlAttributePtr;
@ -134,7 +134,7 @@ typedef enum {
typedef struct xmlElementContent {
xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */
xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */
const xmlChar *name; /* Element name */
const xmlChar *name; /* Element name */
struct xmlElementContent *c1; /* first child */
struct xmlElementContent *c2; /* second child */
} xmlElementContent;
@ -148,7 +148,7 @@ typedef enum {
} xmlElementTypeVal;
typedef struct xmlElement {
const xmlChar *name; /* Element name */
const xmlChar *name; /* Element name */
xmlElementTypeVal type; /* The type */
xmlElementContentPtr content; /* the allowed element content */
xmlAttributePtr attributes; /* List of the declared attributes */
@ -169,8 +169,8 @@ typedef enum {
typedef struct xmlNs {
struct xmlNs *next; /* next Ns link for this node */
xmlNsType type; /* global or local */
const xmlChar *href; /* URL for the namespace */
const xmlChar *prefix; /* prefix for the namespace */
const xmlChar *href; /* URL for the namespace */
const xmlChar *prefix; /* prefix for the namespace */
} xmlNs;
typedef xmlNs *xmlNsPtr;
@ -178,9 +178,9 @@ typedef xmlNs *xmlNsPtr;
* An XML DtD, as defined by <!DOCTYPE.
*/
typedef struct xmlDtd {
const xmlChar *name; /* Name of the DTD */
const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */
const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */
const xmlChar *name; /* Name of the DTD */
const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */
const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */
void *notations; /* Hash table for notations if any */
void *elements; /* Hash table for elements if any */
void *attributes; /* Hash table for attributes if any */
@ -200,7 +200,7 @@ typedef struct xmlAttr {
xmlElementType type; /* XML_ATTRIBUTE_NODE, must be third ! */
struct xmlNode *node; /* attr->node link */
struct xmlAttr *next; /* attribute list link */
const xmlChar *name; /* the name of the property */
const xmlChar *name; /* the name of the property */
struct xmlNode *val; /* the value of the property */
xmlNs *ns; /* pointer to the associated namespace */
} xmlAttr;
@ -212,7 +212,7 @@ typedef xmlAttr *xmlAttrPtr;
typedef struct xmlID {
struct xmlID *next; /* next ID */
const xmlChar *value; /* The ID name */
const xmlChar *value; /* The ID name */
xmlAttrPtr attr; /* The attribut holding it */
} xmlID;
typedef xmlID *xmlIDPtr;
@ -223,7 +223,7 @@ typedef xmlID *xmlIDPtr;
typedef struct xmlRef {
struct xmlRef *next; /* next Ref */
const xmlChar *value; /* The Ref name */
const xmlChar *value; /* The Ref name */
xmlAttrPtr attr; /* The attribut holding it */
} xmlRef;
typedef xmlRef *xmlRefPtr;
@ -244,10 +244,10 @@ typedef struct xmlNode {
struct xmlNode *childs; /* parent->childs link */
struct xmlNode *last; /* last child link */
struct xmlAttr *properties; /* properties list */
const xmlChar *name; /* the name of the node, or the entity */
const xmlChar *name; /* the name of the node, or the entity */
xmlNs *ns; /* pointer to the associated namespace */
xmlNs *nsDef; /* namespace definitions on this node */
xmlChar *content; /* the content */
xmlChar *content; /* the content */
} _xmlNode;
typedef _xmlNode xmlNode;
typedef _xmlNode *xmlNodePtr;
@ -262,8 +262,8 @@ typedef struct xmlDoc {
#endif
xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */
char *name; /* name/filename/URI of the document */
const xmlChar *version; /* the XML version string */
const xmlChar *encoding; /* encoding, if any */
const xmlChar *version; /* the XML version string */
const xmlChar *encoding; /* encoding, if any */
int compression;/* level of zlib compression */
int standalone; /* standalone document (no external refs) */
struct xmlDtd *intSubset; /* the document internal subset */
@ -333,7 +333,7 @@ xmlNsPtr xmlNewNs (xmlNodePtr node,
const xmlChar *href,
const xmlChar *prefix);
void xmlFreeNs (xmlNsPtr cur);
xmlDocPtr xmlNewDoc (const xmlChar *version);
xmlDocPtr xmlNewDoc (const xmlChar *version);
void xmlFreeDoc (xmlDocPtr cur);
xmlAttrPtr xmlNewDocProp (xmlDocPtr doc,
const xmlChar *name,
@ -434,14 +434,14 @@ xmlNsPtr xmlCopyNamespaceList (xmlNsPtr cur);
xmlAttrPtr xmlSetProp (xmlNodePtr node,
const xmlChar *name,
const xmlChar *value);
xmlChar * xmlGetProp (xmlNodePtr node,
xmlChar * xmlGetProp (xmlNodePtr node,
const xmlChar *name);
xmlNodePtr xmlStringGetNodeList (xmlDocPtr doc,
const xmlChar *value);
xmlNodePtr xmlStringLenGetNodeList (xmlDocPtr doc,
const xmlChar *value,
int len);
xmlChar * xmlNodeListGetString (xmlDocPtr doc,
xmlChar * xmlNodeListGetString (xmlDocPtr doc,
xmlNodePtr list,
int inLine);
void xmlNodeSetContent (xmlNodePtr cur,
@ -454,7 +454,7 @@ void xmlNodeAddContent (xmlNodePtr cur,
void xmlNodeAddContentLen (xmlNodePtr cur,
const xmlChar *content,
int len);
xmlChar * xmlNodeGetContent (xmlNodePtr cur);
xmlChar * xmlNodeGetContent (xmlNodePtr cur);
const xmlChar * xmlNodeGetLang (xmlNodePtr cur);
void xmlNodeSetLang (xmlNodePtr cur,
const xmlChar *lang);

View File

@ -2615,9 +2615,7 @@ xmlChar *
xmlParsePubidLiteral(xmlParserCtxtPtr ctxt) {
const xmlChar *q;
xmlChar *ret = NULL;
/*
* Name ::= (Letter | '_') (NameChar)*
*/
SHRINK;
if (CUR == '"') {
NEXT;
@ -2635,10 +2633,9 @@ xmlParsePubidLiteral(xmlParserCtxtPtr ctxt) {
} else if (CUR == '\'') {
NEXT;
q = CUR_PTR;
while ((IS_LETTER(CUR)) && (CUR != '\''))
NEXT;
if (!IS_LETTER(CUR)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
while (IS_PUBIDCHAR(CUR)) NEXT;
if (CUR != '\'') {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData, "Unfinished PubidLiteral\n");
ctxt->errNo = XML_ERR_LITERAL_NOT_FINISHED;
ctxt->wellFormed = 0;

View File

@ -228,7 +228,7 @@ int main(int argc, char **argv) {
}
}
if (files == 0) {
printf("Usage : %s [--debug] [--copy] [--recover] [--noent] [--noout] XMLfiles ...\n",
printf("Usage : %s [--debug] [--copy] [--recover] [--noent] [--noout] [--valid] [--repeat] XMLfiles ...\n",
argv[0]);
printf("\tParse the XML files and output the result of the parsing\n");
printf("\t--debug : dump a debug tree of the in-memory document\n");
@ -236,6 +236,7 @@ int main(int argc, char **argv) {
printf("\t--recover : output what is parsable on broken XmL documents\n");
printf("\t--noent : substitute entity references by their value\n");
printf("\t--noout : don't output the result\n");
printf("\t--valid : validate the document in addition to std well-formed check\n");
printf("\t--repeat : parse the file 100 times, for timing or profiling\n");
}
xmlMemoryDump();

44
tree.h
View File

@ -99,17 +99,17 @@ typedef enum {
typedef struct xmlEnumeration {
struct xmlEnumeration *next; /* next one */
const xmlChar *name; /* Enumeration name */
const xmlChar *name; /* Enumeration name */
} xmlEnumeration;
typedef xmlEnumeration *xmlEnumerationPtr;
typedef struct xmlAttribute {
const xmlChar *elem; /* Element holding the attribute */
const xmlChar *name; /* Attribute name */
const xmlChar *elem; /* Element holding the attribute */
const xmlChar *name; /* Attribute name */
struct xmlAttribute *next; /* list of attributes of an element */
xmlAttributeType type; /* The type */
xmlAttributeDefault def; /* the default */
const xmlChar *defaultValue;/* or the default value */
const xmlChar *defaultValue;/* or the default value */
xmlEnumerationPtr tree; /* or the enumeration tree if any */
} xmlAttribute;
typedef xmlAttribute *xmlAttributePtr;
@ -134,7 +134,7 @@ typedef enum {
typedef struct xmlElementContent {
xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */
xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */
const xmlChar *name; /* Element name */
const xmlChar *name; /* Element name */
struct xmlElementContent *c1; /* first child */
struct xmlElementContent *c2; /* second child */
} xmlElementContent;
@ -148,7 +148,7 @@ typedef enum {
} xmlElementTypeVal;
typedef struct xmlElement {
const xmlChar *name; /* Element name */
const xmlChar *name; /* Element name */
xmlElementTypeVal type; /* The type */
xmlElementContentPtr content; /* the allowed element content */
xmlAttributePtr attributes; /* List of the declared attributes */
@ -169,8 +169,8 @@ typedef enum {
typedef struct xmlNs {
struct xmlNs *next; /* next Ns link for this node */
xmlNsType type; /* global or local */
const xmlChar *href; /* URL for the namespace */
const xmlChar *prefix; /* prefix for the namespace */
const xmlChar *href; /* URL for the namespace */
const xmlChar *prefix; /* prefix for the namespace */
} xmlNs;
typedef xmlNs *xmlNsPtr;
@ -178,9 +178,9 @@ typedef xmlNs *xmlNsPtr;
* An XML DtD, as defined by <!DOCTYPE.
*/
typedef struct xmlDtd {
const xmlChar *name; /* Name of the DTD */
const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */
const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */
const xmlChar *name; /* Name of the DTD */
const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */
const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */
void *notations; /* Hash table for notations if any */
void *elements; /* Hash table for elements if any */
void *attributes; /* Hash table for attributes if any */
@ -200,7 +200,7 @@ typedef struct xmlAttr {
xmlElementType type; /* XML_ATTRIBUTE_NODE, must be third ! */
struct xmlNode *node; /* attr->node link */
struct xmlAttr *next; /* attribute list link */
const xmlChar *name; /* the name of the property */
const xmlChar *name; /* the name of the property */
struct xmlNode *val; /* the value of the property */
xmlNs *ns; /* pointer to the associated namespace */
} xmlAttr;
@ -212,7 +212,7 @@ typedef xmlAttr *xmlAttrPtr;
typedef struct xmlID {
struct xmlID *next; /* next ID */
const xmlChar *value; /* The ID name */
const xmlChar *value; /* The ID name */
xmlAttrPtr attr; /* The attribut holding it */
} xmlID;
typedef xmlID *xmlIDPtr;
@ -223,7 +223,7 @@ typedef xmlID *xmlIDPtr;
typedef struct xmlRef {
struct xmlRef *next; /* next Ref */
const xmlChar *value; /* The Ref name */
const xmlChar *value; /* The Ref name */
xmlAttrPtr attr; /* The attribut holding it */
} xmlRef;
typedef xmlRef *xmlRefPtr;
@ -244,10 +244,10 @@ typedef struct xmlNode {
struct xmlNode *childs; /* parent->childs link */
struct xmlNode *last; /* last child link */
struct xmlAttr *properties; /* properties list */
const xmlChar *name; /* the name of the node, or the entity */
const xmlChar *name; /* the name of the node, or the entity */
xmlNs *ns; /* pointer to the associated namespace */
xmlNs *nsDef; /* namespace definitions on this node */
xmlChar *content; /* the content */
xmlChar *content; /* the content */
} _xmlNode;
typedef _xmlNode xmlNode;
typedef _xmlNode *xmlNodePtr;
@ -262,8 +262,8 @@ typedef struct xmlDoc {
#endif
xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */
char *name; /* name/filename/URI of the document */
const xmlChar *version; /* the XML version string */
const xmlChar *encoding; /* encoding, if any */
const xmlChar *version; /* the XML version string */
const xmlChar *encoding; /* encoding, if any */
int compression;/* level of zlib compression */
int standalone; /* standalone document (no external refs) */
struct xmlDtd *intSubset; /* the document internal subset */
@ -333,7 +333,7 @@ xmlNsPtr xmlNewNs (xmlNodePtr node,
const xmlChar *href,
const xmlChar *prefix);
void xmlFreeNs (xmlNsPtr cur);
xmlDocPtr xmlNewDoc (const xmlChar *version);
xmlDocPtr xmlNewDoc (const xmlChar *version);
void xmlFreeDoc (xmlDocPtr cur);
xmlAttrPtr xmlNewDocProp (xmlDocPtr doc,
const xmlChar *name,
@ -434,14 +434,14 @@ xmlNsPtr xmlCopyNamespaceList (xmlNsPtr cur);
xmlAttrPtr xmlSetProp (xmlNodePtr node,
const xmlChar *name,
const xmlChar *value);
xmlChar * xmlGetProp (xmlNodePtr node,
xmlChar * xmlGetProp (xmlNodePtr node,
const xmlChar *name);
xmlNodePtr xmlStringGetNodeList (xmlDocPtr doc,
const xmlChar *value);
xmlNodePtr xmlStringLenGetNodeList (xmlDocPtr doc,
const xmlChar *value,
int len);
xmlChar * xmlNodeListGetString (xmlDocPtr doc,
xmlChar * xmlNodeListGetString (xmlDocPtr doc,
xmlNodePtr list,
int inLine);
void xmlNodeSetContent (xmlNodePtr cur,
@ -454,7 +454,7 @@ void xmlNodeAddContent (xmlNodePtr cur,
void xmlNodeAddContentLen (xmlNodePtr cur,
const xmlChar *content,
int len);
xmlChar * xmlNodeGetContent (xmlNodePtr cur);
xmlChar * xmlNodeGetContent (xmlNodePtr cur);
const xmlChar * xmlNodeGetLang (xmlNodePtr cur);
void xmlNodeSetLang (xmlNodePtr cur,
const xmlChar *lang);